ftrack_api.event.expression

class ftrack_api.event.expression.Parser[source]

Parse string based expression into Expression instance.

__init__()[source]

Initialise parser.

parse(expression)[source]

Parse string expression into Expression.

Raise ftrack_api.exception.ParseError if expression could not be parsed.

class ftrack_api.event.expression.Expression[source]

Represent a structured expression to test candidates against.

match(candidate)[source]

Return whether candidate satisfies this expression.

__init__()
class ftrack_api.event.expression.All(expressions=None)[source]

Match candidate that matches all of the specified expressions.

Note

If no expressions are supplied then will always match.

__init__(expressions=None)[source]

Initialise with list of expressions to match against.

match(candidate)[source]

Return whether candidate satisfies this expression.

class ftrack_api.event.expression.Any(expressions=None)[source]

Match candidate that matches any of the specified expressions.

Note

If no expressions are supplied then will never match.

__init__(expressions=None)[source]

Initialise with list of expressions to match against.

match(candidate)[source]

Return whether candidate satisfies this expression.

class ftrack_api.event.expression.Not(expression)[source]

Negate expression.

__init__(expression)[source]

Initialise with expression to negate.

match(candidate)[source]

Return whether candidate satisfies this expression.

class ftrack_api.event.expression.Condition(key, operator, value)[source]

Represent condition.

__init__(key, operator, value)[source]

Initialise condition.

key is the key to check on the data when matching. It can be a nested key represented by dots. For example, ‘data.eventType’ would attempt to match candidate[‘data’][‘eventType’]. If the candidate is missing any of the requested keys then the match fails immediately.

operator is the operator function to use to perform the match between the retrieved candidate value and the conditional value.

If value is a string, it can use a wildcard ‘*’ at the end to denote that any values matching the substring portion are valid when matching equality only.

match(candidate)[source]

Return whether candidate satisfies this expression.