databroker.Broker.alias

Broker.alias(key, **query)[source]

Create an alias for a query.

Parameters
keystring

must be a valid Python identifier

query

keyword argument comprising a query

Examples

Define an alias that searches for headers with purpose=’calibration’.

>>> db.alias('cal', purpose='calibration')

Use it.

>>> headers = db.cal  # -> db(purpose='calibration')

Review defined aliases.

>>> db.aliases
{'cal': {'purpose': 'calibration'}}