Skip to content

Commit 96fabd2

Browse files
authored
VER: Release 0.24.0
See release notes.
2 parents 91fe40a + 0bd50d6 commit 96fabd2

File tree

74 files changed

+992
-497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+992
-497
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ubuntu-latest, macos-latest, windows-latest]
13-
python-version: ["3.8", "3.9", "3.10", "3.11"]
13+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1414
name: build - Python ${{ matrix.python-version }} (${{ matrix.os }})
1515
runs-on: ${{ matrix.os }}
1616

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Changelog
22

3+
## 0.24.0 - 2023-11-23
4+
5+
This release adds support for DBN v2 as well as Python v3.12.
6+
7+
DBN v2 delivers improvements to the `Metadata` header symbology, new `stype_in` and `stype_out` fields for `SymbolMappingMsg`, and extends the symbol field length for `SymbolMappingMsg` and `InstrumentDefMsg`. The entire change notes are available [here](https://github.com/databento/dbn/releases/tag/v0.14.0). Users who wish to convert DBN v1 files to v2 can use the `dbn-cli` tool available in the [databento-dbn](https://github.com/databento/dbn/) crate. On a future date, the Databento live and historical APIs will stop serving DBN v1.
8+
9+
This release of `databento-python` is fully compatible with both DBN v1 and v2, so this upgrade should be seamless for most users.
10+
11+
In some cases, DBN v1 records will be converted to their v2 counterparts:
12+
- When iterating a `DBNStore` and with `DBNStore.replay`
13+
- When iterating a `Live` client and records dispatched to callbacks
14+
15+
#### Enhancements
16+
- Added support for Python 3.12
17+
- Improved the performance for stream writes in the `Live` client
18+
- Upgraded `databento-dbn` to 0.14.2
19+
- Added `databento.common.types` module to hold common type annotations
20+
21+
#### Bug fixes
22+
- Fixed an issue where specifying an OHLCV schema in `DBNStore.to_ndarray` or `DBNStore.to_df` would not properly filter records by their interval
23+
- Fixed an issue where `DBNStore.to_ndarray` and `DBNStore.to_df` with a non-zero count could get stuck in a loop if the DBN data did not contain any records
24+
25+
#### Breaking Changes
26+
- `DBNStore` iteration and `DBNStore.replay` will upgrade DBN version 1 messages to version 2
27+
- `Live` client iteration and callbacks upgrade DBN version 1 messages to version 2
28+
- Moved `DBNRecord`, `RecordCallback`, and `ExceptionCallback` types to them `databento.common.types` module
29+
- Moved `AUTH_TIMEOUT_SECONDS` and `CONNECT_TIMEOUT_SECONDS` constants from the `databento.live` module to `databento.live.session`
30+
- Moved `INT64_NULL` from the `databento.common.dbnstore` module to `databento.common.constants`
31+
- Moved `SCHEMA_STRUCT_MAP` from the `databento.common.data` module to `databento.common.constants`
32+
- Removed `schema` parameter from `DataFrameIterator` constructor, `struct_type` is to be used instead
33+
- Removed `NON_SCHEMA_RECORD_TYPES` constant as it is no longer used
34+
- Removed `DERIV_SCHEMAS` constant as it is no longer used
35+
- Removed `SCHEMA_COLUMNS` constant as it is no longer used
36+
- Removed `SCHEMA_DTYPES_MAP` constant as it is no longer used
37+
- Removed empty `databento.common.data` module
38+
339
## 0.23.1 - 2023-11-10
440

541
#### Enhancements

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The library is fully compatible with the latest distribution of Anaconda 3.8 and
3232
The minimum dependencies as found in the `pyproject.toml` are also listed below:
3333
- python = "^3.8"
3434
- aiohttp = "^3.8.3"
35-
- databento-dbn = "0.13.0"
35+
- databento-dbn = "0.14.2"
3636
- numpy= ">=1.23.5"
3737
- pandas = ">=1.5.3"
3838
- requests = ">=2.24.0"

databento/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
from databento.common.publishers import Publisher
3838
from databento.common.publishers import Venue
3939
from databento.common.symbology import InstrumentMap
40+
from databento.common.types import DBNRecord
4041
from databento.historical.api import API_VERSION
4142
from databento.historical.client import Historical
42-
from databento.live import DBNRecord
4343
from databento.live.client import Live
4444
from databento.version import __version__ # noqa
4545

databento/common/constants.py

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,59 @@
1-
ALL_SYMBOLS = "ALL_SYMBOLS"
1+
from __future__ import annotations
2+
3+
from typing import Final
4+
5+
import numpy as np
6+
from databento_dbn import ImbalanceMsg
7+
from databento_dbn import InstrumentDefMsg
8+
from databento_dbn import InstrumentDefMsgV1
9+
from databento_dbn import MBOMsg
10+
from databento_dbn import MBP1Msg
11+
from databento_dbn import MBP10Msg
12+
from databento_dbn import OHLCVMsg
13+
from databento_dbn import Schema
14+
from databento_dbn import StatMsg
15+
from databento_dbn import TradeMsg
16+
17+
from databento.common.types import DBNRecord
18+
19+
20+
ALL_SYMBOLS: Final = "ALL_SYMBOLS"
21+
22+
23+
DEFINITION_TYPE_MAX_MAP: Final = {
24+
x[0]: np.iinfo(x[1]).max
25+
for x in InstrumentDefMsg._dtypes
26+
if not isinstance(x[1], str)
27+
}
28+
29+
INT64_NULL: Final = 9223372036854775807
30+
31+
SCHEMA_STRUCT_MAP: Final[dict[Schema, type[DBNRecord]]] = {
32+
Schema.DEFINITION: InstrumentDefMsg,
33+
Schema.IMBALANCE: ImbalanceMsg,
34+
Schema.MBO: MBOMsg,
35+
Schema.MBP_1: MBP1Msg,
36+
Schema.MBP_10: MBP10Msg,
37+
Schema.OHLCV_1S: OHLCVMsg,
38+
Schema.OHLCV_1M: OHLCVMsg,
39+
Schema.OHLCV_1H: OHLCVMsg,
40+
Schema.OHLCV_1D: OHLCVMsg,
41+
Schema.STATISTICS: StatMsg,
42+
Schema.TBBO: MBP1Msg,
43+
Schema.TRADES: TradeMsg,
44+
}
45+
46+
SCHEMA_STRUCT_MAP_V1: Final[dict[Schema, type[DBNRecord]]] = {
47+
Schema.DEFINITION: InstrumentDefMsgV1,
48+
Schema.IMBALANCE: ImbalanceMsg,
49+
Schema.MBO: MBOMsg,
50+
Schema.MBP_1: MBP1Msg,
51+
Schema.MBP_10: MBP10Msg,
52+
Schema.OHLCV_1S: OHLCVMsg,
53+
Schema.OHLCV_1M: OHLCVMsg,
54+
Schema.OHLCV_1H: OHLCVMsg,
55+
Schema.OHLCV_1D: OHLCVMsg,
56+
Schema.STATISTICS: StatMsg,
57+
Schema.TBBO: MBP1Msg,
58+
Schema.TRADES: TradeMsg,
59+
}

databento/common/data.py

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)