tiled.queries.KeyPresent

class tiled.queries.KeyPresent(key: str, exists: bool = True)[source]

Query to retrieve containers that have a specific key at any level.

Parameters:
keystr

e.g. “color”, “sample.name”

existsbool

Set to True by default, but can be set to False to find the inverse

Examples
——–
Search for containers that have the key “color”
>>> c.search(KeyPresent(“color”))
Search for containers that do not have the key “sample.name”
>>> c.search(KeyPresent(“sample.name”, exists=False))
__init__(key: str, exists: bool = True) None

Methods

__init__(key[, exists])

decode(*, key, exists)

encode()

Attributes

exists

key