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.