Skip to content

Commit d119369

Browse files
authored
VER: Release 0.50.0
See release notes.
2 parents 455c2f8 + 05f5804 commit d119369

File tree

15 files changed

+216
-70
lines changed

15 files changed

+216
-70
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ jobs:
3030
shell: bash
3131

3232
- name: Test (release)
33-
timeout-minutes: 2
33+
timeout-minutes: 3
3434
if: ${{ github.ref == 'refs/heads/main' }}
3535
run: scripts/test.sh --release
3636
shell: bash
3737

3838
- name: Test
39-
timeout-minutes: 2
39+
timeout-minutes: 3
4040
if: ${{ github.ref != 'refs/heads/main' }}
4141
run: scripts/test.sh
4242
shell: bash

CHANGELOG.md

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

3+
## 0.50.0 - 2025-03-18
4+
5+
#### Enhancements
6+
- Added new venues, datasets, and publishers for ICE Futures US, ICE Futures Europe (Financial products), Eurex, and European Energy Exchange (EEX)
7+
- Added export of the following enums from `databento_dbn` to the root `databento` package:
8+
- `Action`
9+
- `InstrumentClass`
10+
- `MatchAlgorithm`
11+
- `RType`
12+
- `SecurityUpdateAction`
13+
- `Side`
14+
- `StatUpdateAction`
15+
- `TriState`
16+
- `UserDefinedInstrument`
17+
- `VersionUpgradePolicy`
18+
- Added export of the following constants from `databento_dbn` to the root `databento` package:
19+
- `DBN_VERSION`
20+
- `FIXED_PRICE_SCALE`
21+
- `UNDEF_ORDER_SIZE`
22+
- `UNDEF_PRICE`
23+
- `UNDEF_STAT_QUANTITY`
24+
- `UNDEF_TIMESTAMP`
25+
- Added export of `BidAskPair` and `ConsolidatedBidAskPair` from `databento_dbn` to the root `databento` package
26+
- Upgraded `databento-dbn` to 0.29.0
27+
- Added `COMMODITY_SPOT` `InstrumentClass` variant
28+
- Improved handling of `datetime` and `date` objects in `start` and `end` parameters
29+
330
## 0.49.0 - 2025-03-04
431

532
#### 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.9 and
3232
The minimum dependencies as found in the `pyproject.toml` are also listed below:
3333
- python = "^3.9"
3434
- aiohttp = "^3.8.3"
35-
- databento-dbn = "0.27.0"
35+
- databento-dbn = "0.29.0"
3636
- numpy= ">=1.23.5"
3737
- pandas = ">=1.5.3"
3838
- pip-system-certs = ">=4.0" (Windows only)

databento/__init__.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
import logging
22
import warnings
33

4+
from databento_dbn import DBN_VERSION
5+
from databento_dbn import FIXED_PRICE_SCALE
6+
from databento_dbn import UNDEF_ORDER_SIZE
7+
from databento_dbn import UNDEF_PRICE
8+
from databento_dbn import UNDEF_STAT_QUANTITY
9+
from databento_dbn import UNDEF_TIMESTAMP
10+
from databento_dbn import Action
11+
from databento_dbn import BidAskPair
412
from databento_dbn import CMBP1Msg
513
from databento_dbn import Compression
14+
from databento_dbn import ConsolidatedBidAskPair
615
from databento_dbn import Encoding
716
from databento_dbn import ErrorMsg
817
from databento_dbn import ImbalanceMsg
18+
from databento_dbn import InstrumentClass
919
from databento_dbn import InstrumentDefMsg
20+
from databento_dbn import MatchAlgorithm
1021
from databento_dbn import MBOMsg
1122
from databento_dbn import MBP1Msg
1223
from databento_dbn import MBP10Msg
1324
from databento_dbn import Metadata
1425
from databento_dbn import OHLCVMsg
26+
from databento_dbn import RType
1527
from databento_dbn import Schema
28+
from databento_dbn import SecurityUpdateAction
29+
from databento_dbn import Side
1630
from databento_dbn import StatMsg
1731
from databento_dbn import StatType
32+
from databento_dbn import StatUpdateAction
1833
from databento_dbn import StatusAction
1934
from databento_dbn import StatusMsg
2035
from databento_dbn import StatusReason
@@ -23,6 +38,9 @@
2338
from databento_dbn import SystemMsg
2439
from databento_dbn import TradeMsg
2540
from databento_dbn import TradingEvent
41+
from databento_dbn import TriState
42+
from databento_dbn import UserDefinedInstrument
43+
from databento_dbn import VersionUpgradePolicy
2644
from databento_dbn.v2 import BBO1MMsg
2745
from databento_dbn.v2 import BBO1SMsg
2846
from databento_dbn.v2 import CBBO1MMsg
@@ -60,16 +78,25 @@
6078

6179
__all__ = [
6280
"API_VERSION",
81+
"DBN_VERSION",
82+
"FIXED_PRICE_SCALE",
83+
"UNDEF_ORDER_SIZE",
84+
"UNDEF_PRICE",
85+
"UNDEF_STAT_QUANTITY",
86+
"UNDEF_TIMESTAMP",
87+
"Action",
6388
"BBO1MMsg",
6489
"BBO1SMsg",
6590
"BentoClientError",
6691
"BentoError",
6792
"BentoHttpError",
6893
"BentoServerError",
94+
"BidAskPair",
6995
"CBBO1MMsg",
7096
"CBBO1SMsg",
7197
"CMBP1Msg",
7298
"Compression",
99+
"ConsolidatedBidAskPair",
73100
"DBNRecord",
74101
"DBNStore",
75102
"Dataset",
@@ -80,25 +107,31 @@
80107
"Historical",
81108
"HistoricalGateway",
82109
"ImbalanceMsg",
110+
"InstrumentClass",
83111
"InstrumentDefMsg",
84112
"InstrumentMap",
85113
"Live",
86114
"MBOMsg",
87115
"MBP1Msg",
88116
"MBP10Msg",
117+
"MatchAlgorithm",
89118
"Metadata",
90119
"OHLCVMsg",
91120
"Packaging",
92121
"Publisher",
122+
"RType",
93123
"ReconnectPolicy",
94124
"RecordFlags",
95125
"Reference",
96126
"RollRule",
97127
"SType",
98128
"Schema",
129+
"SecurityUpdateAction",
130+
"Side",
99131
"SplitDuration",
100132
"StatMsg",
101133
"StatType",
134+
"StatUpdateAction",
102135
"StatusAction",
103136
"StatusMsg",
104137
"StatusReason",
@@ -110,7 +143,10 @@
110143
"TCBBOMsg",
111144
"TradeMsg",
112145
"TradingEvent",
146+
"TriState",
147+
"UserDefinedInstrument",
113148
"Venue",
149+
"VersionUpgradePolicy",
114150
]
115151

116152
# Setup logging

databento/common/parsing.py

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from collections.abc import Iterable
44
from datetime import date
5+
from datetime import datetime
56
from functools import partial
67
from functools import singledispatch
78
from io import BytesIO
@@ -222,13 +223,13 @@ def optional_date_to_string(value: date | str | None) -> str | None:
222223
return datetime_to_date_string(value)
223224

224225

225-
def datetime_to_string(value: pd.Timestamp | date | str | int) -> str:
226+
def datetime_to_string(value: pd.Timestamp | datetime | date | str | int) -> str:
226227
"""
227228
Return a valid datetime string from the given value.
228229
229230
Parameters
230231
----------
231-
value : pd.Timestamp or date or str
232+
value : pd.Timestamp, datetime, date, str, or int
232233
The value to parse.
233234
234235
Returns
@@ -240,6 +241,10 @@ def datetime_to_string(value: pd.Timestamp | date | str | int) -> str:
240241
return value
241242
elif isinstance(value, int):
242243
return str(value)
244+
elif isinstance(value, date):
245+
return value.isoformat()
246+
elif isinstance(value, datetime):
247+
return value.isoformat()
243248
else:
244249
return pd.to_datetime(value).isoformat()
245250

@@ -250,7 +255,7 @@ def datetime_to_date_string(value: pd.Timestamp | date | str | int) -> str:
250255
251256
Parameters
252257
----------
253-
value : pd.Timestamp or date or str
258+
value : pd.Timestamp, date, str, or int
254259
The value to parse.
255260
256261
Returns
@@ -262,19 +267,21 @@ def datetime_to_date_string(value: pd.Timestamp | date | str | int) -> str:
262267
return value
263268
elif isinstance(value, int):
264269
return str(value)
270+
elif isinstance(value, date):
271+
return value.isoformat()
265272
else:
266273
return pd.to_datetime(value).date().isoformat()
267274

268275

269276
def optional_datetime_to_string(
270-
value: pd.Timestamp | date | str | int | None,
277+
value: pd.Timestamp | datetime | date | str | int | None,
271278
) -> str | None:
272279
"""
273280
Return a valid datetime string from the given value (if not None).
274281
275282
Parameters
276283
----------
277-
value : pd.Timestamp or date or str, optional
284+
value : pd.Timestamp, datetime, date, str, or int, optional
278285
The value to parse.
279286
280287
Returns
@@ -296,7 +303,7 @@ def datetime_to_unix_nanoseconds(
296303
297304
Parameters
298305
----------
299-
value : pd.Timestamp or date or str or int
306+
value : pd.Timestamp, date, str, or int
300307
The value to parse.
301308
302309
Returns
@@ -306,22 +313,20 @@ def datetime_to_unix_nanoseconds(
306313
"""
307314
if isinstance(value, int):
308315
return value # no checking on integer values
309-
310-
if isinstance(value, date):
316+
elif isinstance(value, date):
311317
return pd.to_datetime(value, utc=True).value
312-
313-
if isinstance(value, pd.Timestamp):
318+
elif isinstance(value, pd.Timestamp):
314319
return value.value
320+
else:
321+
try:
322+
nanoseconds = pd.to_datetime(value, utc=True).value
323+
except Exception: # different versions of pandas raise different exceptions
324+
nanoseconds = pd.to_datetime(
325+
int(value),
326+
utc=True,
327+
).value
315328

316-
try:
317-
nanoseconds = pd.to_datetime(value, utc=True).value
318-
except Exception: # different versions of pandas raise different exceptions
319-
nanoseconds = pd.to_datetime(
320-
int(value),
321-
utc=True,
322-
).value
323-
324-
return nanoseconds
329+
return nanoseconds
325330

326331

327332
def optional_datetime_to_unix_nanoseconds(
@@ -333,7 +338,7 @@ def optional_datetime_to_unix_nanoseconds(
333338
334339
Parameters
335340
----------
336-
value : pd.Timestamp or date or str or int
341+
value : pd.Timestamp, date, str, or int
337342
The value to parse.
338343
339344
Returns

0 commit comments

Comments
 (0)