tiled.queries.Key

class tiled.queries.Key(key)[source]

Compare a key in the metadata to a value using standard Python operators.

This itself is not a query, but comparing it with a value, as shown in the examples below, produces a query.

Parameters
keystr

Examples

Search for equality, comparison, or membership in a collection.

>>> c.search(Key("color") == "red")
>>> c.search(Key("temperature") >= 300)
>>> c.search(Key("temperature") <= 300)
>>> c.search(Key("position") > 5.0)
>>> c.search(Key("position") < 5.0)
__init__(key)[source]

Methods

__init__(key)