Crate dbn

source ·
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 async feature flag
  • Encoders for CSV, DBN, and JSON, both sync and async, with the async feature 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 encoding
  • python: enables pyo3 bindings
  • serde: enables deriving serde traits for types
  • trivial_copy: enables deriving the Copy trait for records

Re-exports

Modules

  • Contains dataset code constants.
  • Decoding DBN and Zstd-compressed DBN files and streams. Decoders implement the DecodeDbn trait.
  • Encoding DBN and Zstd-compressed DBN files and streams. Encoders implement the EncodeDbn trait.
  • 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 Metadata struct which comes at the beginning of any DBN file or stream and MetadataBuilder for creating a Metadata with defaults.
  • Contains new types for pretty-printing values found in DBN records.
  • Enumerations for different data sources, venues, and publishers.
  • pythonpython
    Python wrappers around dbn functions. These are implemented here instead of in python/ to be able to implement pyo3 traits for DBN types.
  • Market data types for encoding different Databento Schemas and conversion functions.
  • The RecordRef struct for non-owning references to DBN records.

Macros

Constants