Databroker
|build_status| |coverage| |pypi_version| |license|
Deprecation Notice
Databroker is no longer recommended for new users or facilities adopting
Bluesky. Instead, Tiled_ with Bluesky Tiled Plugins_ is recommended as the
canonical way to persist and access data and metadata from Bluesky.
Databroker now serves two purposes that remain relevant for some users and some faciilities. First, it contains code adapting the legacy MongoDB-based Bluesky document storage to Tiled---effectively a server-side plugin for Tiled. Second, it wraps the Tiled Python client to provide an API backward-compatible with legacy Databroker user code. If you do not have MongoDB-based Bluesky storage and you do not have legacy Databroker user code, you do not need Databroker.
Databroker will be maintained by NSLS-II through April 2027 at minimum to support the transition from MongoDB-based document storage to PostgreSQL-based storage. The Python user interface may be maintained longer still, depending on the need.
============== ==============================================================
PyPI pip install databroker
Conda conda install -c conda-forge databroker
Source code https://github.com/bluesky/databroker
Documentation https://blueskyproject.io/databroker
============== ==============================================================
The bundle of metadata and data looks like this, for example.
.. code:: python
run BlueskyRun uid='4a794c63-8223-4893-895e-d16e763188a8' exit_status='success' 2020-03-07 09:17:40.436 -- 2020-03-07 09:28:53.173 Streams: * primary * baseline
Additional user metadata beyond what is shown is stored in run.metadata.
The bundle contains some number of logical tables of data ("streams"). They can
be accessed by name and read into a standard data structure from xarray_.
.. code:: python
>>> run.primary.read()
<xarray.Dataset>
Dimensions: (time: 411)
Coordinates:
* time (time) float64 1.584e+09 1.584e+09 ... 1.584e+09
Data variables:
I0 (time) float64 13.07 13.01 12.95 ... 9.862 9.845
It (time) float64 11.52 11.47 11.44 ... 4.971 4.968
Ir (time) float64 10.96 10.92 10.88 ... 4.761 4.763
dwti_dwell_time (time) float64 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
dwti_dwell_time_setpoint (time) float64 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
dcm_energy (time) float64 1.697e+04 1.698e+04 ... 1.791e+04
dcm_energy_setpoint (time) float64 1.697e+04 1.698e+04 ... 1.791e+04
Common search queries can be done with a high-level Python interface.
.. code:: python
>>> from databroker.queries import TimeRange
>>> catalog.search(TimeRange(since="2020"))
Custom queries can be done with the MongoDB query language_.
.. code:: python
>>> query = {
... "motors": {"$in": ["x", "y"]}, # scanning either x or y
... "temperature" {"$lt": 300}, # temperature less than 300
... "sample.element": "Ni",
... }
>>> catalog.search(query)
See the tutorials for more.
.. |build_status| image:: https://github.com/bluesky/databroker/workflows/Unit%20Tests/badge.svg?branch=master :target: https://github.com/bluesky/databroker/actions?query=workflow%3A%22Unit+Tests%22 :alt: Build Status
.. |coverage| image:: https://codecov.io/gh/bluesky/databroker/branch/master/graph/badge.svg :target: https://codecov.io/gh/bluesky/databroker :alt: Test Coverage
.. |pypi_version| image:: https://img.shields.io/pypi/v/databroker.svg :target: https://pypi.org/project/databroker :alt: Latest PyPI version
.. |license| image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg :target: https://opensource.org/licenses/BSD-3-Clause :alt: BSD 3-Clause License
.. _xarray: https://xarray.pydata.org/
.. _MongoDB query language: https://docs.mongodb.com/manual/reference/operator/query/
.. _Bluesky Data Model: https://blueskyproject.io/event-model/main/user/explanations/data-model.html
.. _Suitcase: https://blueskyproject.io/suitcase/
.. _Intake: https://intake.readthedocs.io/en/latest/
.. _Bluesky Tiled Plugins: https://blueskyproject.io/bluesky-tiled-plugins/
.. _Tiled: https://blueskyproject.io/tiled/
Metadata
Release files for databroker 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| databroker-2.0.2.tar.gz | 180.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| databroker-2.0.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 374.6 kB
Release files / databroker-2.0.2.tar.gz
| Download URL | databroker-2.0.2.tar.gz |
|---|---|
| Size | 180.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ea79d4f6ea2fb6075e4aed16327ee9b2ee733decfd8182ac411df3983d39fdd
|
|
BLAKE2b-256 checksum How to use checksums |
626245f90d4563c4c1d4cb25c410241a4f62e698c6f09053cf6294dcfdf7cda2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / databroker-2.0.2-py2.py3-none-any.whl
| Download URL | databroker-2.0.2-py2.py3-none-any.whl |
|---|---|
| Size | 194.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
917483dbcc93d3cec6ccc94a9ae1d7870fdb7ace447765655aa13b4f9252b788
|
|
BLAKE2b-256 checksum How to use checksums |
1c8ab34eb6d94c0b7ac75d278e6c67990c4be5311ea9d9f6e6c101bf48df3068
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log