Skip to main content

databento-python

test python pypi-version license code-style: black Slack

The official Python client library for Databento.

Key features include:

  • Fast, lightweight access to both live and historical data from multiple markets.
  • Multiple schemas such as MBO, MBP, top of book, OHLCV, last sale, and more.
  • Fully normalized, i.e. identical message schemas for both live and historical data, across multiple asset classes.
  • Provides mappings between different symbology systems, including smart symbology for futures rollovers.
  • Point-in-time instrument definitions, free of look-ahead bias and retroactive adjustments.
  • Reads and stores market data in an extremely efficient file format using Databento Binary Encoding.
  • Event-driven market replay, including at high-frequency order book granularity.
  • Support for batch download of flat files.
  • Support for pandas, CSV, and JSON.

Documentation

The best place to begin is with our Getting started guide.

You can find our full client API reference on the Historical Reference and Live Reference sections of our documentation. See also the Examples section for various tutorials and code samples.

Requirements

The library is fully compatible with distributions of Anaconda 2023.x and above. The minimum dependencies as found in the pyproject.toml are also listed below:

  • python >= 3.11
  • aiohttp >= 3.8.3
  • certifi >= 2026.10.19
  • databento-dbn ~= 0.73.0
  • numpy >= 1.23.5
  • pandas >= 1.5.3
  • pip-system-certs >= 4.0 (Windows only)
  • pyarrow >= 13.0.0
  • requests >= 2.27.0
  • zstandard >= 0.21.0 (Python < 3.14 only)

Installation

To install the latest stable version of the package from PyPI:

pip install -U databento

Building from source

Building this project requires uv; no other Python tooling is needed, as uv provisions the interpreter and virtual environment for you.

git clone https://github.com/databento/databento-python.git
cd databento-python
scripts/build.sh

This creates a .venv in the project directory containing the dev dependency group and an editable install of the package. From there:

scripts/test.sh     # run the test suite
scripts/lint.sh     # type check with mypy
uv run python       # start a REPL in the environment

To produce a wheel and source distribution under dist/:

uv build

Usage

The library needs to be configured with an API key from your account. Sign up for free and you will automatically receive a set of API keys to start with. Each API key is a 32-character string starting with db-, that can be found on the API Keys page of your Databento user portal.

A simple Databento application looks like this:

import databento as db

client = db.Historical('YOUR_API_KEY')
data = client.timeseries.get_range(
    dataset='GLBX.MDP3',
    symbols='ES.FUT',
    stype_in='parent',
    start='2022-06-10T14:30',
    end='2022-06-10T14:40',
)

data.replay(callback=print)  # market replay, with `print` as event handler

Replace YOUR_API_KEY with an actual API key, then run this program.

This uses .replay() to access the entire block of data and dispatch each data event to an event handler. You can also use .to_df() or .to_ndarray() to cast the data into a Pandas DataFrame or numpy ndarray:

df = data.to_df()  # to DataFrame
array = data.to_ndarray()  # to ndarray

Note that the API key was also passed as a parameter, which is not recommended for production applications. Instead, you can leave out this parameter to pass your API key via the DATABENTO_API_KEY environment variable:

import databento as db

# Pass as parameter
client = db.Historical('YOUR_API_KEY')

# Or, pass as `DATABENTO_API_KEY` environment variable
client = db.Historical()

License

Distributed under the Apache 2.0 License.

Metadata

Release files for databento 0.90.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for databento 0.90.0
File Size Uploaded Provenance Actions
databento-0.90.0.tar.gz 80.6 kB Without provenance Details for databento-0.90.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for databento 0.90.0
File Interpreter ABI Platform Actions
databento-0.90.0-py3-none-any.whl Python 3 none any Details for databento-0.90.0-py3-none-any.whl

Total release size: 177.8 kB

Release files / databento-0.90.0.tar.gz

Download URL databento-0.90.0.tar.gz
Size 80.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fe4d9ec0ab9800dc9326db2e5703c804234b7a877f56f81d8ad82b42a21aeec1
BLAKE2b-256 checksum
How to use checksums
63dcd6b3a137b1b8b7a68e15db9623d14e57df20e42437e25bdf64b00d38bb69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / databento-0.90.0-py3-none-any.whl

Download URL databento-0.90.0-py3-none-any.whl
Size 97.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9aec40557c5331ccc9685e6e58a7bc88d0ed4c64dbf4ee7717683d4a597e6edf
BLAKE2b-256 checksum
How to use checksums
06de809d8b7bd1b00eface75eb500001f9a8bc8cef0f53dd998e1ea29e8c8d58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for databento 0.90.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.90.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page