Skip to main content

Library for working with the Databento Binary Encoding (DBZ) format

Project description

dbz-lib

The official library for working with the Databento Binary Encoding (DBZ) format.

Usage

The primary point for entrypoint for dbz_lib is the Dbz object, which represents the contents of one DBZ file or byte stream. To read a DBZ file with MBO data and print each row:

use db_def::tick::TickMsg;
use dbz_lib::Dbz;

let dbz = Dbz::from_file("20201228.mbo.dbz")?;
for tick in dbz.try_into_iter::<TickMsg>() {
    println!("{tick:?}");
}

The documentation provides an overview of all methods and features.

Documentation

FIXME: when prepping to release to crates.io

Building

dbz is written in Rust, so you'll need to have Rust installed first.

To build, run the following commands:

git clone https://github.com/databento/dbz
cd dbz
cargo build --release

Python bindings

To also include the optional Python bindings when running any cargo command, pass the --all-features flag or --features=python. For example, to build all of dbz with Python bindings, run:

cargo build --all-features

To create a Python package from dbz-lib, you'll need to install Maturin. For a Python package to develop against, run:

maturin develop -F python

This will install a package named dbz_lib in your current Python environment.

Testing

Tests are run through cargo test and are located within each module.

License

Distributed under the Apache 2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

dbz_lib-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (714.0 kB view hashes)

Uploaded Python 3 manylinux: glibc 2.5+ x86-64

dbz_lib-0.1.3-cp310-cp310-manylinux_2_28_x86_64.whl (7.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

dbz_lib-0.1.3-cp310-cp310-macosx_10_7_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

dbz_lib-0.1.3-cp39-cp39-manylinux_2_28_x86_64.whl (7.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

dbz_lib-0.1.3-cp39-cp39-macosx_10_7_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

dbz_lib-0.1.3-cp38-cp38-manylinux_2_28_x86_64.whl (7.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

dbz_lib-0.1.3-cp38-cp38-macosx_10_7_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

dbz_lib-0.1.3-cp37-cp37m-manylinux_2_28_x86_64.whl (7.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.28+ x86-64

dbz_lib-0.1.3-cp37-cp37m-macosx_10_7_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page