Expand description
The official crate for working with the Databento Binary Encoding (DBN), a fast message encoding and storage format for normalized market data. The DBN specification includes a simple metadata header, and a fixed set of struct definitions, which enforce a standardized way to normalize market data.
The crate supports reading DBN files and streams and converting them to other
Encodings, as well as updating legacy DBZ files to DBN.
This crate provides:
- Decoders for DBN and DBZ (the precursor to DBN), both
sync and async, with the
asyncfeature flag - Encoders for CSV, DBN, and JSON, both sync and async,
with the
asyncfeature flag - Normalized market data struct definitions corresponding to the different market data schemas offered by Databento
- A wrapper type for holding a reference to a record struct of a dynamic type
- Helper functions and macros for common tasks
Feature flags
async: enables async decoding and encodingpython: enablespyo3bindingsserde: enables derivingserdetraits for typestrivial_copy: enables deriving theCopytrait for records
Re-exports
pub use crate::error::Error;pub use crate::error::Result;pub use crate::metadata::MappingInterval;pub use crate::metadata::Metadata;pub use crate::metadata::MetadataBuilder;pub use crate::metadata::SymbolMapping;pub use crate::record_ref::RecordRef;
Modules
- Contains dataset code constants.
- Decoding DBN and Zstd-compressed DBN files and streams. Decoders implement the
DecodeDbntrait. - Encoding DBN and Zstd-compressed DBN files and streams. Encoders implement the
EncodeDbntrait. - Enums used in Databento APIs.
- Types for errors that can occur while working with DBN.
- Helper macros for working with multiple RTypes, Schemas, and types of records.
- Contains
Metadatastruct which comes at the beginning of any DBN file or stream andMetadataBuilderfor creating aMetadatawith defaults. - Contains new types for pretty-printing values found in DBN records.
- Enumerations for different data sources, venues, and publishers.
- python
pythonPython wrappers around dbn functions. These are implemented here instead of inpython/to be able to implementpyo3traits for DBN types. - Market data types for encoding different Databento
Schemas and conversion functions. - The
RecordRefstruct for non-owning references to DBN records.
Macros
- Specializes a generic async function to all record types and dispatches based
rtype. - Specializes a generic function to all record types and dispatches based
rtype. - Specializes a generic function to all record types wrapped in
WithTsOutand dispatches based on thertype. - Specializes a generic async function to all record types and dispatches based
rtypeandts_out. - Specializes a generic function to all record types and dispatches based on the
rtypeandts_out. - Specializes a generic async method to all record types with an associated schema.
- Specializes a generic function to all record types with an associated schema.
- Specializes a generic method to all record types with an associated schema.
Constants
- The current version of the DBN encoding, which is different from the crate version.
- The denominator of fixed prices in DBN.
- The length of symbol fields (21 characters plus null terminator).
- The sentinel value for an unset or null order quantity.
- The sentinel value for an unset or null price.
- The sentinel value for an unset or null stat quantity.
- The sentinel value for an unset or null timestamp.