Python bindings for encoding and decoding Databento Binary Encoding (DBN)
Project description
databento-dbn
Python bindings for the dbn
Rust library.
Used by the Databento Python client library.
Using this library is for advanced users and is not fully documented or supported.
Installation
To install the latest stable version from PyPI:
pip install -U databento-dbn
Usage
To read the metadata from a DBN file into a dict
, read the raw bytes and pass them to decode_metadata
.
from databento_dbn import decode_metadata
with open("my.dbn.zst", "rb") as fin:
metadata = decode_metadata(fin.read())
# Print symbology mappings
print(metadata["mappings"])
You can write Zstd-compressed DBN files using write_dbn_file
:
from databento_dbn import write_dbn_file
records = [
{"rtype": 160, "publisher_id": 1, "instrument_id": 1, "ts_event": 647784973705, "order_id": 1,
"price": 3723000000000, "size": 1, "flags": 128, "channel_id": 0, "action": ord('C'),
"side": ord('A'), "ts_recv": 1609160400000704060, "ts_in_delta": 0, "sequence": 1170352}
]
with open("my.dbn.zst", "wb") as out:
write_dbn_file(file=out, compression="zstd", schema="mbo", dataset="custom",
records=records, stype="instrument_id")
Note that the keys in the dictionaries in records
must match the field names of the schema, or
the function will raise a KeyError
.
Building
databento-dbn
is written in Rust, so you'll need to have Rust installed
as well as Maturin.
To build, run the following commands:
git clone https://github.com/databento/dbn
cd dbn
maturin build
To build the Python package and install it for the active Python interpreter in your PATH
, run:
maturin develop
This will install a package named databento-dbn
in your current Python environment.
License
Distributed under the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for databento_dbn-0.8.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 297e7a41ed2e9550bb4ba677c7a44edb845fe805065290313be45e75cb3cd4b1 |
|
MD5 | 3bd1207f07365d4900b45e85dfe170f9 |
|
BLAKE2b-256 | f8a519890040d8ac578dda18f655dab4071379c8cd81f911b4421842a3def3ad |
Hashes for databento_dbn-0.8.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 016f3e1d9d6bbfff9dbc39546e0cd20c138977a8d8fa1d818ed10c43ff228b53 |
|
MD5 | cb6bcabbfd7cb796ac3bd8aaa1225ad7 |
|
BLAKE2b-256 | 0771b8b932859f9a1c8cdf580251a6d8e13d358c1ad8780b06d2ccf5b77b88e3 |
Hashes for databento_dbn-0.8.0-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad7d95a4197b4dc74f9592527ff77363cf40c8c0ad859c485649304cc81b2efd |
|
MD5 | bec1d64995d333ea9206edcf18ef6b70 |
|
BLAKE2b-256 | f7485b6e809850203f0bc61e330d6ddf17622e9d4f774c13b577864b8eb1d824 |
Hashes for databento_dbn-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e94890bee50ad306ac8511be3505f6de33cd52bc01e4b20bde76f54b8fe8c49 |
|
MD5 | c289070de7eac77b4af8f93a29c41f75 |
|
BLAKE2b-256 | 5f2a9cb20ea74d4dfdda24c3b96404c6096da951dfb10998733d9fed9bb89dbe |
Hashes for databento_dbn-0.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 261bdc7f1c90b853e3957bdbcf6f2f730acf796c8348006f7baaf4007e818b09 |
|
MD5 | 61562ef5c3273527ec431e1539468037 |
|
BLAKE2b-256 | bdf027955648965a09feda7806dbe2833415be185639484192228d8d499fa083 |
Hashes for databento_dbn-0.8.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e665e587f38a849265f249a25a0194f7a403da6425b9aa1cb2fa3be7883694e1 |
|
MD5 | a239083685bf8919782116baeb9cb75e |
|
BLAKE2b-256 | dc694f3b372b2abfa3666a8dbf70f7e6e248bfc2b81a952acd4cb8020488a56f |
Hashes for databento_dbn-0.8.0-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96f7ae3a796dac70cebccfae9a37c0a8694fab67f3bd37c0b46a1906b1b9df32 |
|
MD5 | 9bb9ea4962a804a4467fc1fe280b7ce6 |
|
BLAKE2b-256 | c47aa225c3fcb04042178f0ce8bfed5abd804fdb45b90cee4654f78a0f6b3fc8 |
Hashes for databento_dbn-0.8.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b05c607eafdea4dbc79bc93acb353ebefa5b0caa49286469444082676b49a46 |
|
MD5 | fdb54fcb95ea3149ea76f86ef2cefd9b |
|
BLAKE2b-256 | 70eb395dff4881e31fe2d3771c9575075da496e09b1797c1744f02e06e4caef3 |
Hashes for databento_dbn-0.8.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ebfd9b4f297fe3edc7f17569954aa8b1d16bcb04d216ffd144a26c53f69a1eb |
|
MD5 | 96ce9a328e01aa39a2d690ea795f63ad |
|
BLAKE2b-256 | 0cff863317bc17cc22c856a8118556aaa53ac9208608fbc6148ecc511852f4a2 |
Hashes for databento_dbn-0.8.0-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33d71a9266d017ba4b549dc1f00da2970e50203d800ec6eebf78f2def8bb757b |
|
MD5 | 78bfedbf868145a7c38fa05327a0b86e |
|
BLAKE2b-256 | 91dd409a3bf95d466dd47db4052ba61ae2c8bf739438f80cb49a1200c9645963 |
Hashes for databento_dbn-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6fb22be79407ef825d6b1416de2866bec9fb8a20d4ed65e8727e38b822b23f3 |
|
MD5 | a90bb9e834fb020037ca123e05c47d8a |
|
BLAKE2b-256 | df3738bb87419442c9736790812e68ce56273914b61d0bb71050f96e3ead383f |
Hashes for databento_dbn-0.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c1fdca1d991ccf9aae806e5d6f8904c2c981adf091a34ab628617787e18569c |
|
MD5 | 15ba816bf2d34d4b0eb8663a9072b915 |
|
BLAKE2b-256 | 1f13717fd83c6b52a84d95ffbb495a91b5bce4308e96b899e88d7e936b7feb7c |
Hashes for databento_dbn-0.8.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f515418e51f7d8f1a303cb80c580e87b12687c1b0544a0cc1a32f778bb0c90 |
|
MD5 | 51bf3f0ca2e1e8a89d2a2b81ac106dfe |
|
BLAKE2b-256 | 71a88b35be9bb97f65ce722fcdd063cbfe4c2641988731e2d83435ac373b20e9 |
Hashes for databento_dbn-0.8.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb47db2161f8a08e2474305088d74dd6f4e119cb340908ad65f8ecd584c8c7fc |
|
MD5 | cb245228e5ebcb487830a886a9a649c0 |
|
BLAKE2b-256 | 927a75fd124f1213d4a61773a6e0ee15a09c4ecd7423df6843fa8d08127fa9c8 |
Hashes for databento_dbn-0.8.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d23730526d1df91e5ade9e89af24b1bad76ac2bd70b709a876d37dac29ecb2ba |
|
MD5 | b735f9a55bdd2532cd7f05c825207eaa |
|
BLAKE2b-256 | 208fae710a4ba430be0dcf8347cabd920a018520a268e2377200490eb36615af |
Hashes for databento_dbn-0.8.0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d0fd98611b7bbc0bf294230591d5ee4189aa03d33eeb93032fffb10b6d891b0 |
|
MD5 | b926a88c2b62794c3f8ca2eaee6b8505 |
|
BLAKE2b-256 | 6852b206293e50c50c655574b2e48c6f5c84d3e22fd5a2ac1c3a7e4ff4e507a5 |
Hashes for databento_dbn-0.8.0-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f24a7f01fbb52c4f0c42137e64f9d0126781e6dbef2bb4cad189a00e0fb42f8 |
|
MD5 | cfdec849b7da3d3138333a2a9cb41022 |
|
BLAKE2b-256 | a9b6f94c593daff734a9942f2c120621b0ab9860ca2d22e6b20cff6df320b851 |
Hashes for databento_dbn-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70a8082a14fa6159d168d728342e54cfea7119007b0581ed9212dc698bbdf1af |
|
MD5 | 935a6c3778199c9e3a0f548f6a17e0d8 |
|
BLAKE2b-256 | 8cfe98894568659601c6839116b73777cbf0a4b55f884973d7236bf900e670f6 |
Hashes for databento_dbn-0.8.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b1623b5f729842c8f7075cc5f02a0478ea8f683da1aa36684ba08474185db67 |
|
MD5 | 5dd0056e0f9d281c2b217a5eea680bb1 |
|
BLAKE2b-256 | 87c4606bc3d75fa02cb6737babbab3813e28b8d1fc47084fe3ff0a5c6949069f |
Hashes for databento_dbn-0.8.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf7a7bfc1dc0399a267aba6828e63cb4c648c6a3c9ed2fcc587b45f1a261b9ed |
|
MD5 | 5055eaf97b169b80b0c6e03b25cbb6bd |
|
BLAKE2b-256 | a00c4c8e89e472c5fbacc02612b4e9d6f00364cb5bc4b2c9dc57af409dbf9c7a |
Hashes for databento_dbn-0.8.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6cb6e9f210518ed86670263400a68e7133e2bdbeef95ebcd4b11a0e759e4359 |
|
MD5 | b7d0f420c003a6d72efe3cddf3e3d5a0 |
|
BLAKE2b-256 | 4c41d99d1fa75a969fbb6d5c2176a8fddd4d8dfe46c766014875d3ea5410e5d1 |
Hashes for databento_dbn-0.8.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 573804f2f41cfdc8bac98208b88bb51d5050b2baa4870bd07f76b08518c52519 |
|
MD5 | 03f965a4756399cd4919e1d237731dde |
|
BLAKE2b-256 | 63d4dcc3705f2daa240bf5280ddab1bca75937bd382bd241b94feabb5cd7a745 |
Hashes for databento_dbn-0.8.0-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b87f3b7d09377160f41e58f8773888cf3aaf1d2e5a89315874a1dd10bee9e410 |
|
MD5 | 7552a5581488194304370fbca378d4b0 |
|
BLAKE2b-256 | b20b1b59e7593ee97d7f6fa66d7a9e83667738a4519747e2043b75e51b676dec |
Hashes for databento_dbn-0.8.0-cp38-cp38-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09dd60712b76a203801ee3cbb169151496483a8b1efa4044c968cfdc62c8308e |
|
MD5 | e99431c89703f379ed4e709a602546f5 |
|
BLAKE2b-256 | 2690f4b9729bc4396822347118d92ec1d774a1acd53adaca1f03e7b09cc5b777 |
Hashes for databento_dbn-0.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06f6e5ffa57239b78107a5b17058f2dff63dea4f5df26d532cc94732503ad094 |
|
MD5 | 1912d3f2e2b69a4a542cf5b5b57936a8 |
|
BLAKE2b-256 | 1cd29a9f4d6c9d9a5fd15d3ae4211cfd3ce2fc30bbb0b08b6ff3417a38152ac2 |
Hashes for databento_dbn-0.8.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 274c1a6eb386b331468d4d2c2c09f869caf915f1a9def94df909ad274ea724a9 |
|
MD5 | 5bbc67b3396f7ede5d6fbb0303d3e028 |
|
BLAKE2b-256 | 087f87d29fdcc6504a7f31655155851bb9e5c962926470d7a609bbd81fa5b20e |
Hashes for databento_dbn-0.8.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d903d67771bb46b6eed40105eb085280bb69270448e70ca00709c8495f91637 |
|
MD5 | 2a1a4584ebc2c609e848ad37fce01451 |
|
BLAKE2b-256 | 0cba5ac5efac2b68a0d2063975c75c31d068e166eb480c6b505772556bbe4780 |
Hashes for databento_dbn-0.8.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec1c263574b7230f2fb6505a371cc9d1433e95038406ef044990cfc6309e8e8c |
|
MD5 | 8e252a0b3a4dc7148f6cbc2bcdd92484 |
|
BLAKE2b-256 | 7b3af1de96aef0370b9ac36a87e1ab6e45371dbc5a09153af6966705535a850c |