databento 0.89.0__tar.gz → 0.90.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {databento-0.89.0 → databento-0.90.0}/PKG-INFO +6 -6
- {databento-0.89.0 → databento-0.90.0}/README.md +2 -2
- {databento-0.89.0 → databento-0.90.0}/databento/common/dbnstore.py +1 -1
- {databento-0.89.0 → databento-0.90.0}/databento/common/enums.py +16 -35
- {databento-0.89.0 → databento-0.90.0}/databento/common/publishers.py +38 -39
- {databento-0.89.0 → databento-0.90.0}/databento/live/client.py +11 -6
- {databento-0.89.0 → databento-0.90.0}/databento/live/gateway.py +3 -5
- {databento-0.89.0 → databento-0.90.0}/databento/live/session.py +45 -30
- databento-0.90.0/databento/version.py +1 -0
- {databento-0.89.0 → databento-0.90.0}/pyproject.toml +6 -6
- {databento-0.89.0 → databento-0.90.0}/pyproject.toml.orig +6 -6
- databento-0.89.0/databento/version.py +0 -1
- {databento-0.89.0 → databento-0.90.0}/LICENSE +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/__init__.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/__init__.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/bentologging.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/constants.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/cram.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/error.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/http.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/iterator.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/parsing.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/symbology.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/system.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/types.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/validation.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/common/zstd.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/historical/__init__.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/historical/api/__init__.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/historical/api/batch.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/historical/api/metadata.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/historical/api/symbology.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/historical/api/timeseries.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/historical/client.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/live/__init__.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/live/protocol.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/py.typed +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/reference/__init__.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/reference/api/__init__.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/reference/api/adjustment.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/reference/api/corporate.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/reference/api/security.py +0 -0
- {databento-0.89.0 → databento-0.90.0}/databento/reference/client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: databento
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.90.0
|
|
4
4
|
Summary: Official Python client library for Databento
|
|
5
5
|
Author: Databento
|
|
6
6
|
Author-email: Databento <support@databento.com>
|
|
@@ -9,11 +9,11 @@ License-File: LICENSE
|
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
17
17
|
Classifier: Topic :: Office/Business :: Financial
|
|
18
18
|
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
19
19
|
Classifier: Topic :: Software Development :: Libraries
|
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
21
21
|
Requires-Dist: aiohttp>=3.8.3,<4.0.0 ; python_full_version < '3.12'
|
|
22
22
|
Requires-Dist: aiohttp>=3.9.0,<4.0.0 ; python_full_version >= '3.12'
|
|
23
23
|
Requires-Dist: certifi>=2026.10.19
|
|
24
|
-
Requires-Dist: databento-dbn~=0.
|
|
24
|
+
Requires-Dist: databento-dbn~=0.73.0
|
|
25
25
|
Requires-Dist: numpy>=1.23.5 ; python_full_version < '3.12'
|
|
26
26
|
Requires-Dist: numpy>=1.26.0 ; python_full_version >= '3.12'
|
|
27
27
|
Requires-Dist: pandas>=1.5.3,<4.0.0
|
|
@@ -29,7 +29,7 @@ Requires-Dist: pip-system-certs>=4.0 ; sys_platform == 'win32'
|
|
|
29
29
|
Requires-Dist: pyarrow>=13.0.0
|
|
30
30
|
Requires-Dist: requests>=2.27.0
|
|
31
31
|
Requires-Dist: zstandard>=0.21.0 ; python_full_version < '3.14'
|
|
32
|
-
Requires-Python: >=3.
|
|
32
|
+
Requires-Python: >=3.11
|
|
33
33
|
Project-URL: Homepage, https://databento.com
|
|
34
34
|
Project-URL: Documentation, https://databento.com/docs
|
|
35
35
|
Project-URL: Repository, https://github.com/databento/databento-python
|
|
@@ -68,10 +68,10 @@ You can find our full client API reference on the [Historical Reference](https:/
|
|
|
68
68
|
## Requirements
|
|
69
69
|
The library is fully compatible with distributions of Anaconda 2023.x and above.
|
|
70
70
|
The minimum dependencies as found in the `pyproject.toml` are also listed below:
|
|
71
|
-
- python >= 3.
|
|
71
|
+
- python >= 3.11
|
|
72
72
|
- aiohttp >= 3.8.3
|
|
73
73
|
- certifi >= 2026.10.19
|
|
74
|
-
- databento-dbn ~= 0.
|
|
74
|
+
- databento-dbn ~= 0.73.0
|
|
75
75
|
- numpy >= 1.23.5
|
|
76
76
|
- pandas >= 1.5.3
|
|
77
77
|
- pip-system-certs >= 4.0 (Windows only)
|
|
@@ -30,10 +30,10 @@ You can find our full client API reference on the [Historical Reference](https:/
|
|
|
30
30
|
## Requirements
|
|
31
31
|
The library is fully compatible with distributions of Anaconda 2023.x and above.
|
|
32
32
|
The minimum dependencies as found in the `pyproject.toml` are also listed below:
|
|
33
|
-
- python >= 3.
|
|
33
|
+
- python >= 3.11
|
|
34
34
|
- aiohttp >= 3.8.3
|
|
35
35
|
- certifi >= 2026.10.19
|
|
36
|
-
- databento-dbn ~= 0.
|
|
36
|
+
- databento-dbn ~= 0.73.0
|
|
37
37
|
- numpy >= 1.23.5
|
|
38
38
|
- pandas >= 1.5.3
|
|
39
39
|
- pip-system-certs >= 4.0 (Windows only)
|
|
@@ -878,7 +878,7 @@ class DBNStore:
|
|
|
878
878
|
map_symbols: bool = True,
|
|
879
879
|
schema: Schema | str | None = None,
|
|
880
880
|
tz: datetime.tzinfo | str | Default[datetime.tzinfo] = Default[datetime.tzinfo](
|
|
881
|
-
datetime.
|
|
881
|
+
datetime.UTC,
|
|
882
882
|
),
|
|
883
883
|
count: int | None = None,
|
|
884
884
|
) -> pd.DataFrame | DataFrameIterator:
|
|
@@ -2,8 +2,8 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from collections.abc import Callable
|
|
4
4
|
from enum import Enum
|
|
5
|
-
from enum import Flag
|
|
6
5
|
from enum import IntFlag
|
|
6
|
+
from enum import StrEnum
|
|
7
7
|
from enum import unique
|
|
8
8
|
from typing import TypeVar
|
|
9
9
|
|
|
@@ -83,30 +83,9 @@ def coercible(enum_type: type[M]) -> type[M]:
|
|
|
83
83
|
return enum_type
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
class StringyMixin:
|
|
87
|
-
"""
|
|
88
|
-
Mixin class for overloading __str__ on Enum types.
|
|
89
|
-
|
|
90
|
-
This will use the Enumerations subclass, if any, to modify the
|
|
91
|
-
behavior of str().
|
|
92
|
-
|
|
93
|
-
For subclasses of enum.Flag a comma separated string of names is
|
|
94
|
-
returned. For integer enumerations, the lowercase member name is
|
|
95
|
-
returned. For string enumerations, the value is returned.
|
|
96
|
-
|
|
97
|
-
"""
|
|
98
|
-
|
|
99
|
-
def __str__(self) -> str:
|
|
100
|
-
if isinstance(self, Flag):
|
|
101
|
-
return ", ".join(f.name.lower() for f in self.__class__ if f in self)
|
|
102
|
-
if isinstance(self, int):
|
|
103
|
-
return getattr(self, "name").lower()
|
|
104
|
-
return getattr(self, "value")
|
|
105
|
-
|
|
106
|
-
|
|
107
86
|
@unique
|
|
108
87
|
@coercible
|
|
109
|
-
class HistoricalGateway(
|
|
88
|
+
class HistoricalGateway(StrEnum):
|
|
110
89
|
"""
|
|
111
90
|
Represents a historical data center gateway location.
|
|
112
91
|
"""
|
|
@@ -116,7 +95,7 @@ class HistoricalGateway(StringyMixin, str, Enum):
|
|
|
116
95
|
|
|
117
96
|
@unique
|
|
118
97
|
@coercible
|
|
119
|
-
class FeedMode(
|
|
98
|
+
class FeedMode(StrEnum):
|
|
120
99
|
"""
|
|
121
100
|
Represents a data feed mode.
|
|
122
101
|
"""
|
|
@@ -128,7 +107,7 @@ class FeedMode(StringyMixin, str, Enum):
|
|
|
128
107
|
|
|
129
108
|
@unique
|
|
130
109
|
@coercible
|
|
131
|
-
class SplitDuration(
|
|
110
|
+
class SplitDuration(StrEnum):
|
|
132
111
|
"""
|
|
133
112
|
Represents the duration before splitting for each batched data file.
|
|
134
113
|
"""
|
|
@@ -142,7 +121,7 @@ class SplitDuration(StringyMixin, str, Enum):
|
|
|
142
121
|
|
|
143
122
|
@unique
|
|
144
123
|
@coercible
|
|
145
|
-
class Packaging(
|
|
124
|
+
class Packaging(StrEnum):
|
|
146
125
|
"""
|
|
147
126
|
Represents the packaging method for batched data files.
|
|
148
127
|
"""
|
|
@@ -154,7 +133,7 @@ class Packaging(StringyMixin, str, Enum):
|
|
|
154
133
|
|
|
155
134
|
@unique
|
|
156
135
|
@coercible
|
|
157
|
-
class Delivery(
|
|
136
|
+
class Delivery(StrEnum):
|
|
158
137
|
"""
|
|
159
138
|
Represents the delivery mechanism for batched data.
|
|
160
139
|
"""
|
|
@@ -164,7 +143,7 @@ class Delivery(StringyMixin, str, Enum):
|
|
|
164
143
|
|
|
165
144
|
@unique
|
|
166
145
|
@coercible
|
|
167
|
-
class RollRule(
|
|
146
|
+
class RollRule(StrEnum):
|
|
168
147
|
"""
|
|
169
148
|
Represents a smart symbology roll rule.
|
|
170
149
|
"""
|
|
@@ -176,7 +155,7 @@ class RollRule(StringyMixin, str, Enum):
|
|
|
176
155
|
|
|
177
156
|
@unique
|
|
178
157
|
@coercible
|
|
179
|
-
class SymbologyResolution(
|
|
158
|
+
class SymbologyResolution(StrEnum):
|
|
180
159
|
"""
|
|
181
160
|
Status code of symbology resolution.
|
|
182
161
|
|
|
@@ -193,8 +172,7 @@ class SymbologyResolution(StringyMixin, str, Enum):
|
|
|
193
172
|
|
|
194
173
|
@unique
|
|
195
174
|
@coercible
|
|
196
|
-
|
|
197
|
-
class RecordFlags(StringyMixin, IntFlag): # type: ignore
|
|
175
|
+
class RecordFlags(IntFlag):
|
|
198
176
|
"""
|
|
199
177
|
Represents record flags.
|
|
200
178
|
|
|
@@ -227,10 +205,13 @@ class RecordFlags(StringyMixin, IntFlag): # type: ignore
|
|
|
227
205
|
F_MAYBE_BAD_BOOK = 4
|
|
228
206
|
F_PUBLISHER_SPECIFIC = 2
|
|
229
207
|
|
|
208
|
+
def __str__(self) -> str:
|
|
209
|
+
return ", ".join(f.name.lower() for f in self.__class__ if f in self)
|
|
210
|
+
|
|
230
211
|
|
|
231
212
|
@unique
|
|
232
213
|
@coercible
|
|
233
|
-
class ReconnectPolicy(
|
|
214
|
+
class ReconnectPolicy(StrEnum):
|
|
234
215
|
"""
|
|
235
216
|
Live session reconnection policy.
|
|
236
217
|
"""
|
|
@@ -241,7 +222,7 @@ class ReconnectPolicy(StringyMixin, str, Enum):
|
|
|
241
222
|
|
|
242
223
|
@unique
|
|
243
224
|
@coercible
|
|
244
|
-
class PriceType(
|
|
225
|
+
class PriceType(StrEnum):
|
|
245
226
|
"""
|
|
246
227
|
Price type for DataFrame price fields.
|
|
247
228
|
"""
|
|
@@ -253,7 +234,7 @@ class PriceType(StringyMixin, str, Enum):
|
|
|
253
234
|
|
|
254
235
|
@unique
|
|
255
236
|
@coercible
|
|
256
|
-
class JobState(
|
|
237
|
+
class JobState(StrEnum):
|
|
257
238
|
"""
|
|
258
239
|
Represents the different states for batch jobs.
|
|
259
240
|
"""
|
|
@@ -265,7 +246,7 @@ class JobState(StringyMixin, str, Enum):
|
|
|
265
246
|
|
|
266
247
|
|
|
267
248
|
@unique
|
|
268
|
-
class SlowReaderBehavior(
|
|
249
|
+
class SlowReaderBehavior(StrEnum):
|
|
269
250
|
"""
|
|
270
251
|
Live session parameter which controls gateway behavior when the client
|
|
271
252
|
falls behind real time.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from enum import
|
|
3
|
+
from enum import StrEnum
|
|
4
4
|
from enum import unique
|
|
5
5
|
|
|
6
|
-
from databento.common.enums import StringyMixin
|
|
7
6
|
from databento.common.enums import coercible
|
|
8
7
|
|
|
9
8
|
|
|
@@ -12,7 +11,7 @@ from databento.common.enums import coercible
|
|
|
12
11
|
|
|
13
12
|
@unique
|
|
14
13
|
@coercible
|
|
15
|
-
class Venue(
|
|
14
|
+
class Venue(StrEnum):
|
|
16
15
|
"""
|
|
17
16
|
A trading execution venue.
|
|
18
17
|
|
|
@@ -21,9 +20,9 @@ class Venue(StringyMixin, str, Enum):
|
|
|
21
20
|
XNAS
|
|
22
21
|
Nasdaq - All Markets.
|
|
23
22
|
XBOS
|
|
24
|
-
Nasdaq
|
|
23
|
+
Nasdaq Texas.
|
|
25
24
|
XPSX
|
|
26
|
-
Nasdaq
|
|
25
|
+
Nasdaq PSX.
|
|
27
26
|
BATS
|
|
28
27
|
Cboe BZX U.S. Equities Exchange.
|
|
29
28
|
BATY
|
|
@@ -37,7 +36,7 @@ class Venue(StringyMixin, str, Enum):
|
|
|
37
36
|
XCIS
|
|
38
37
|
NYSE National, Inc..
|
|
39
38
|
XASE
|
|
40
|
-
NYSE
|
|
39
|
+
NYSE American.
|
|
41
40
|
ARCX
|
|
42
41
|
NYSE Arca.
|
|
43
42
|
XCHI
|
|
@@ -145,11 +144,11 @@ class Venue(StringyMixin, str, Enum):
|
|
|
145
144
|
INAV
|
|
146
145
|
CGIF Intraday Net Asset Values.
|
|
147
146
|
MSTAR
|
|
148
|
-
CGIF
|
|
147
|
+
CGIF Morningstar.
|
|
149
148
|
CCCY
|
|
150
|
-
CGIF
|
|
149
|
+
CGIF Cryptocurrency.
|
|
151
150
|
CGI
|
|
152
|
-
CGIF
|
|
151
|
+
CGIF Cboe Global Indices.
|
|
153
152
|
CDEF
|
|
154
153
|
CGIF Definitions.
|
|
155
154
|
XTKS
|
|
@@ -547,9 +546,9 @@ class Venue(StringyMixin, str, Enum):
|
|
|
547
546
|
if self == Venue.XNAS:
|
|
548
547
|
return "Nasdaq - All Markets"
|
|
549
548
|
if self == Venue.XBOS:
|
|
550
|
-
return "Nasdaq
|
|
549
|
+
return "Nasdaq Texas"
|
|
551
550
|
if self == Venue.XPSX:
|
|
552
|
-
return "Nasdaq
|
|
551
|
+
return "Nasdaq PSX"
|
|
553
552
|
if self == Venue.BATS:
|
|
554
553
|
return "Cboe BZX U.S. Equities Exchange"
|
|
555
554
|
if self == Venue.BATY:
|
|
@@ -563,7 +562,7 @@ class Venue(StringyMixin, str, Enum):
|
|
|
563
562
|
if self == Venue.XCIS:
|
|
564
563
|
return "NYSE National, Inc."
|
|
565
564
|
if self == Venue.XASE:
|
|
566
|
-
return "NYSE
|
|
565
|
+
return "NYSE American"
|
|
567
566
|
if self == Venue.ARCX:
|
|
568
567
|
return "NYSE Arca"
|
|
569
568
|
if self == Venue.XCHI:
|
|
@@ -671,11 +670,11 @@ class Venue(StringyMixin, str, Enum):
|
|
|
671
670
|
if self == Venue.INAV:
|
|
672
671
|
return "CGIF Intraday Net Asset Values"
|
|
673
672
|
if self == Venue.MSTAR:
|
|
674
|
-
return "CGIF
|
|
673
|
+
return "CGIF Morningstar"
|
|
675
674
|
if self == Venue.CCCY:
|
|
676
|
-
return "CGIF
|
|
675
|
+
return "CGIF Cryptocurrency"
|
|
677
676
|
if self == Venue.CGI:
|
|
678
|
-
return "CGIF
|
|
677
|
+
return "CGIF Cboe Global Indices"
|
|
679
678
|
if self == Venue.CDEF:
|
|
680
679
|
return "CGIF Definitions"
|
|
681
680
|
if self == Venue.XTKS:
|
|
@@ -691,7 +690,7 @@ class Venue(StringyMixin, str, Enum):
|
|
|
691
690
|
|
|
692
691
|
@unique
|
|
693
692
|
@coercible
|
|
694
|
-
class Dataset(
|
|
693
|
+
class Dataset(StrEnum):
|
|
695
694
|
"""
|
|
696
695
|
A source of data.
|
|
697
696
|
|
|
@@ -788,11 +787,11 @@ class Dataset(StringyMixin, str, Enum):
|
|
|
788
787
|
INAV_CGIF
|
|
789
788
|
CGIF - Intraday Net Asset Values.
|
|
790
789
|
MSTAR_CGIF
|
|
791
|
-
CGIF -
|
|
790
|
+
CGIF - Morningstar.
|
|
792
791
|
CCCY_CGIF
|
|
793
|
-
CGIF -
|
|
792
|
+
CGIF - Cryptocurrency.
|
|
794
793
|
CGI_CGIF
|
|
795
|
-
CGIF -
|
|
794
|
+
CGIF - Cboe Global Indices.
|
|
796
795
|
XTKS_FLEX
|
|
797
796
|
Arrowhead FLEX.
|
|
798
797
|
XTKT_ITCH
|
|
@@ -1181,11 +1180,11 @@ class Dataset(StringyMixin, str, Enum):
|
|
|
1181
1180
|
if self == Dataset.INAV_CGIF:
|
|
1182
1181
|
return "CGIF - Intraday Net Asset Values"
|
|
1183
1182
|
if self == Dataset.MSTAR_CGIF:
|
|
1184
|
-
return "CGIF -
|
|
1183
|
+
return "CGIF - Morningstar"
|
|
1185
1184
|
if self == Dataset.CCCY_CGIF:
|
|
1186
|
-
return "CGIF -
|
|
1185
|
+
return "CGIF - Cryptocurrency"
|
|
1187
1186
|
if self == Dataset.CGI_CGIF:
|
|
1188
|
-
return "CGIF -
|
|
1187
|
+
return "CGIF - Cboe Global Indices"
|
|
1189
1188
|
if self == Dataset.XTKS_FLEX:
|
|
1190
1189
|
return "Arrowhead FLEX"
|
|
1191
1190
|
if self == Dataset.XTKT_ITCH:
|
|
@@ -1199,7 +1198,7 @@ class Dataset(StringyMixin, str, Enum):
|
|
|
1199
1198
|
|
|
1200
1199
|
@unique
|
|
1201
1200
|
@coercible
|
|
1202
|
-
class Publisher(
|
|
1201
|
+
class Publisher(StrEnum):
|
|
1203
1202
|
"""
|
|
1204
1203
|
A specific Venue from a specific data source.
|
|
1205
1204
|
|
|
@@ -1296,7 +1295,7 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
1296
1295
|
XNAS_QBBO_XNAS
|
|
1297
1296
|
Nasdaq QBBO.
|
|
1298
1297
|
XNAS_NLS_XNAS
|
|
1299
|
-
Nasdaq
|
|
1298
|
+
Nasdaq NLS.
|
|
1300
1299
|
EQUS_PLUS_XCHI
|
|
1301
1300
|
Databento US Equities Plus - NYSE Texas.
|
|
1302
1301
|
EQUS_PLUS_XCIS
|
|
@@ -1382,7 +1381,7 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
1382
1381
|
XNAS_BASIC_XPSX
|
|
1383
1382
|
Nasdaq Basic - Nasdaq PSX.
|
|
1384
1383
|
EQUS_SUMMARY_EQUS
|
|
1385
|
-
Databento Equities Summary.
|
|
1384
|
+
Databento US Equities Summary.
|
|
1386
1385
|
XCIS_TRADESBBO_XCIS
|
|
1387
1386
|
NYSE National Trades and BBO.
|
|
1388
1387
|
XNYS_TRADESBBO_XNYS
|
|
@@ -1480,11 +1479,11 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
1480
1479
|
INAV_CGIF_INAV
|
|
1481
1480
|
CGIF - Intraday Net Asset Values.
|
|
1482
1481
|
MSTAR_CGIF_MSTAR
|
|
1483
|
-
CGIF -
|
|
1482
|
+
CGIF - Morningstar.
|
|
1484
1483
|
CCCY_CGIF_CCCY
|
|
1485
|
-
CGIF -
|
|
1484
|
+
CGIF - Cryptocurrency.
|
|
1486
1485
|
CGI_CGIF_CGI
|
|
1487
|
-
CGIF -
|
|
1486
|
+
CGIF - Cboe Global Indices.
|
|
1488
1487
|
MAIN_CGIF_CDEF
|
|
1489
1488
|
CGIF - Definitions.
|
|
1490
1489
|
XTKS_FLEX_XTKS
|
|
@@ -1502,11 +1501,11 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
1502
1501
|
DBIX_CORE_INAV
|
|
1503
1502
|
CGIF - Intraday Net Asset Values.
|
|
1504
1503
|
DBIX_CORE_MSTAR
|
|
1505
|
-
CGIF -
|
|
1504
|
+
CGIF - Morningstar.
|
|
1506
1505
|
DBIX_CORE_CCCY
|
|
1507
|
-
CGIF -
|
|
1506
|
+
CGIF - Cryptocurrency.
|
|
1508
1507
|
DBIX_CORE_CGI
|
|
1509
|
-
CGIF -
|
|
1508
|
+
CGIF - Cboe Global Indices.
|
|
1510
1509
|
DBIX_CORE_CDEF
|
|
1511
1510
|
CGIF - Definitions.
|
|
1512
1511
|
|
|
@@ -3015,7 +3014,7 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
3015
3014
|
if self == Publisher.XNAS_QBBO_XNAS:
|
|
3016
3015
|
return "Nasdaq QBBO"
|
|
3017
3016
|
if self == Publisher.XNAS_NLS_XNAS:
|
|
3018
|
-
return "Nasdaq
|
|
3017
|
+
return "Nasdaq NLS"
|
|
3019
3018
|
if self == Publisher.EQUS_PLUS_XCHI:
|
|
3020
3019
|
return "Databento US Equities Plus - NYSE Texas"
|
|
3021
3020
|
if self == Publisher.EQUS_PLUS_XCIS:
|
|
@@ -3101,7 +3100,7 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
3101
3100
|
if self == Publisher.XNAS_BASIC_XPSX:
|
|
3102
3101
|
return "Nasdaq Basic - Nasdaq PSX"
|
|
3103
3102
|
if self == Publisher.EQUS_SUMMARY_EQUS:
|
|
3104
|
-
return "Databento Equities Summary"
|
|
3103
|
+
return "Databento US Equities Summary"
|
|
3105
3104
|
if self == Publisher.XCIS_TRADESBBO_XCIS:
|
|
3106
3105
|
return "NYSE National Trades and BBO"
|
|
3107
3106
|
if self == Publisher.XNYS_TRADESBBO_XNYS:
|
|
@@ -3199,11 +3198,11 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
3199
3198
|
if self == Publisher.INAV_CGIF_INAV:
|
|
3200
3199
|
return "CGIF - Intraday Net Asset Values"
|
|
3201
3200
|
if self == Publisher.MSTAR_CGIF_MSTAR:
|
|
3202
|
-
return "CGIF -
|
|
3201
|
+
return "CGIF - Morningstar"
|
|
3203
3202
|
if self == Publisher.CCCY_CGIF_CCCY:
|
|
3204
|
-
return "CGIF -
|
|
3203
|
+
return "CGIF - Cryptocurrency"
|
|
3205
3204
|
if self == Publisher.CGI_CGIF_CGI:
|
|
3206
|
-
return "CGIF -
|
|
3205
|
+
return "CGIF - Cboe Global Indices"
|
|
3207
3206
|
if self == Publisher.MAIN_CGIF_CDEF:
|
|
3208
3207
|
return "CGIF - Definitions"
|
|
3209
3208
|
if self == Publisher.XTKS_FLEX_XTKS:
|
|
@@ -3221,11 +3220,11 @@ class Publisher(StringyMixin, str, Enum):
|
|
|
3221
3220
|
if self == Publisher.DBIX_CORE_INAV:
|
|
3222
3221
|
return "CGIF - Intraday Net Asset Values"
|
|
3223
3222
|
if self == Publisher.DBIX_CORE_MSTAR:
|
|
3224
|
-
return "CGIF -
|
|
3223
|
+
return "CGIF - Morningstar"
|
|
3225
3224
|
if self == Publisher.DBIX_CORE_CCCY:
|
|
3226
|
-
return "CGIF -
|
|
3225
|
+
return "CGIF - Cryptocurrency"
|
|
3227
3226
|
if self == Publisher.DBIX_CORE_CGI:
|
|
3228
|
-
return "CGIF -
|
|
3227
|
+
return "CGIF - Cboe Global Indices"
|
|
3229
3228
|
if self == Publisher.DBIX_CORE_CDEF:
|
|
3230
3229
|
return "CGIF - Definitions"
|
|
3231
3230
|
raise ValueError("Unexpected Publisher value")
|
|
@@ -6,7 +6,6 @@ import os
|
|
|
6
6
|
import queue
|
|
7
7
|
import threading
|
|
8
8
|
from collections.abc import Iterable
|
|
9
|
-
from concurrent import futures
|
|
10
9
|
from datetime import date
|
|
11
10
|
from datetime import datetime
|
|
12
11
|
from os import PathLike
|
|
@@ -65,7 +64,10 @@ class Live:
|
|
|
65
64
|
reconnect_policy: ReconnectPolicy | str, optional
|
|
66
65
|
The reconnect policy for the live session.
|
|
67
66
|
- "none": the client will not reconnect (default)
|
|
68
|
-
- "reconnect": the client will reconnect
|
|
67
|
+
- "reconnect": the client will make a single attempt to reconnect and
|
|
68
|
+
resubscribe after an unexpected disconnection. If that attempt fails the
|
|
69
|
+
session closes and the error is raised from `Live.block_for_close` or
|
|
70
|
+
`Live.wait_for_close`.
|
|
69
71
|
slow_reader_behavior: SlowReadBehavior | str, optional
|
|
70
72
|
The live gateway behavior when the client falls behind real time.
|
|
71
73
|
- "skip": skip records to immediately catch up
|
|
@@ -442,7 +444,9 @@ class Live:
|
|
|
442
444
|
|
|
443
445
|
This will only be called when using a reconnection policy other than
|
|
444
446
|
`ReconnectPolicy.NONE` and if the session has been started with
|
|
445
|
-
`Live.start`.
|
|
447
|
+
`Live.start`. The callback is only called after a successful reconnection;
|
|
448
|
+
a failed reconnection attempt closes the session and its error is raised from
|
|
449
|
+
`Live.block_for_close` or `Live.wait_for_close`.
|
|
446
450
|
|
|
447
451
|
Two instances of `pandas.Timestamp` will be passed to the callback:
|
|
448
452
|
- The last `ts_event` or `Metadata.start` value from the disconnected session.
|
|
@@ -743,7 +747,7 @@ class Live:
|
|
|
743
747
|
self._session.wait_for_close(),
|
|
744
748
|
loop=self._loop,
|
|
745
749
|
).result(timeout=timeout)
|
|
746
|
-
except (
|
|
750
|
+
except (TimeoutError, KeyboardInterrupt) as exc:
|
|
747
751
|
logger.info("closing session due to %s", type(exc).__name__)
|
|
748
752
|
self.terminate()
|
|
749
753
|
if isinstance(exc, KeyboardInterrupt):
|
|
@@ -794,8 +798,9 @@ class Live:
|
|
|
794
798
|
)
|
|
795
799
|
|
|
796
800
|
try:
|
|
797
|
-
|
|
798
|
-
|
|
801
|
+
async with asyncio.timeout(timeout):
|
|
802
|
+
await waiter
|
|
803
|
+
except (TimeoutError, KeyboardInterrupt) as exc:
|
|
799
804
|
logger.info("closing session due to %s", type(exc).__name__)
|
|
800
805
|
self.terminate()
|
|
801
806
|
if isinstance(exc, KeyboardInterrupt):
|
|
@@ -4,8 +4,8 @@ import dataclasses
|
|
|
4
4
|
import logging
|
|
5
5
|
from io import BytesIO
|
|
6
6
|
from operator import attrgetter
|
|
7
|
+
from typing import Self
|
|
7
8
|
from typing import SupportsBytes
|
|
8
|
-
from typing import TypeVar
|
|
9
9
|
|
|
10
10
|
from databento_dbn import Compression
|
|
11
11
|
from databento_dbn import Encoding
|
|
@@ -26,10 +26,8 @@ class GatewayControl(SupportsBytes):
|
|
|
26
26
|
Base class for gateway control messages.
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
|
-
GC = TypeVar("GC", bound="GatewayControl")
|
|
30
|
-
|
|
31
29
|
@classmethod
|
|
32
|
-
def parse(cls
|
|
30
|
+
def parse(cls, line: str | bytes) -> Self:
|
|
33
31
|
"""
|
|
34
32
|
Parse a `GatewayControl` message from a string.
|
|
35
33
|
|
|
@@ -40,7 +38,7 @@ class GatewayControl(SupportsBytes):
|
|
|
40
38
|
|
|
41
39
|
Returns
|
|
42
40
|
-------
|
|
43
|
-
|
|
41
|
+
Self
|
|
44
42
|
|
|
45
43
|
Raises
|
|
46
44
|
------
|
|
@@ -417,7 +417,10 @@ class LiveSession:
|
|
|
417
417
|
reconnect_policy: ReconnectPolicy | str, optional
|
|
418
418
|
The reconnect policy for the live session.
|
|
419
419
|
- "none": the client will not reconnect (default)
|
|
420
|
-
- "reconnect": the client will reconnect
|
|
420
|
+
- "reconnect": the client will make a single attempt to reconnect and
|
|
421
|
+
resubscribe after an unexpected disconnection. If that attempt fails the
|
|
422
|
+
session closes and the error is raised from `Live.block_for_close` or
|
|
423
|
+
`Live.wait_for_close`.
|
|
421
424
|
compression : Compression, optional
|
|
422
425
|
The compression format for the session. Defaults to no compression.
|
|
423
426
|
"""
|
|
@@ -774,15 +777,13 @@ class LiveSession:
|
|
|
774
777
|
logger.info("connecting to remote gateway")
|
|
775
778
|
try:
|
|
776
779
|
factory = partial(self._create_protocol, dataset=dataset)
|
|
777
|
-
|
|
778
|
-
self._loop.create_connection(
|
|
780
|
+
async with asyncio.timeout(CONNECT_TIMEOUT_SECONDS):
|
|
781
|
+
transport, protocol = await self._loop.create_connection(
|
|
779
782
|
protocol_factory=factory,
|
|
780
783
|
host=gateway,
|
|
781
784
|
port=self._port,
|
|
782
|
-
)
|
|
783
|
-
|
|
784
|
-
)
|
|
785
|
-
except asyncio.TimeoutError:
|
|
785
|
+
)
|
|
786
|
+
except TimeoutError:
|
|
786
787
|
raise BentoError(
|
|
787
788
|
f"Connection to {gateway}:{self._port} timed out after "
|
|
788
789
|
f"{CONNECT_TIMEOUT_SECONDS} second(s).",
|
|
@@ -799,11 +800,9 @@ class LiveSession:
|
|
|
799
800
|
)
|
|
800
801
|
|
|
801
802
|
try:
|
|
802
|
-
|
|
803
|
-
protocol.authenticated
|
|
804
|
-
|
|
805
|
-
)
|
|
806
|
-
except asyncio.TimeoutError:
|
|
803
|
+
async with asyncio.timeout(AUTH_TIMEOUT_SECONDS):
|
|
804
|
+
session_id = await protocol.authenticated
|
|
805
|
+
except TimeoutError:
|
|
807
806
|
raise BentoError(
|
|
808
807
|
f"Authentication with {gateway}:{self._port} timed out after "
|
|
809
808
|
f"{AUTH_TIMEOUT_SECONDS} second(s).",
|
|
@@ -838,11 +837,12 @@ class LiveSession:
|
|
|
838
837
|
while True:
|
|
839
838
|
try:
|
|
840
839
|
await self._protocol.disconnected
|
|
841
|
-
except Exception:
|
|
842
|
-
|
|
843
|
-
logger.info("reconnecting live session")
|
|
840
|
+
except Exception as exc:
|
|
841
|
+
logger.info("reconnecting live session: %s", exc)
|
|
844
842
|
|
|
843
|
+
with self._lock:
|
|
845
844
|
should_restart = self.is_streaming()
|
|
845
|
+
dataset = self._protocol._dataset
|
|
846
846
|
if self._protocol._last_ts_event is not None:
|
|
847
847
|
gap_start = pd.Timestamp(
|
|
848
848
|
self._protocol._last_ts_event,
|
|
@@ -855,29 +855,44 @@ class LiveSession:
|
|
|
855
855
|
|
|
856
856
|
if self._transport is not None:
|
|
857
857
|
self._transport.abort()
|
|
858
|
-
self._transport, self._protocol = await self._connect_task(
|
|
859
|
-
dataset=self._protocol._dataset,
|
|
860
|
-
)
|
|
861
858
|
|
|
859
|
+
try:
|
|
860
|
+
transport, protocol = await self._connect_task(dataset=dataset)
|
|
861
|
+
except Exception as exc:
|
|
862
|
+
logger.error("failed to reconnect live session: %s", exc)
|
|
863
|
+
raise
|
|
864
|
+
|
|
865
|
+
with self._lock:
|
|
866
|
+
if self._protocol is None:
|
|
867
|
+
# The session was terminated during the connection attempt
|
|
868
|
+
transport.abort()
|
|
869
|
+
return
|
|
870
|
+
|
|
871
|
+
self._transport, self._protocol = transport, protocol
|
|
862
872
|
self._replay_requests()
|
|
863
873
|
|
|
864
874
|
if should_restart:
|
|
865
875
|
if self._heartbeat_monitor_task is not None:
|
|
866
876
|
self._heartbeat_monitor_task.cancel()
|
|
867
877
|
self._heartbeat_monitor_task = self._loop.create_task(
|
|
868
|
-
self._heartbeat_monitor(
|
|
869
|
-
)
|
|
870
|
-
self._protocol.start()
|
|
871
|
-
metadata = await self._protocol._metadata_received
|
|
872
|
-
gap_end = pd.Timestamp(metadata.start, tz="UTC")
|
|
873
|
-
logger.debug(
|
|
874
|
-
"reconnection gap of %f second(s)",
|
|
875
|
-
(gap_end - gap_start).total_seconds(),
|
|
876
|
-
)
|
|
877
|
-
self._dispatch_reconnect_callbacks(
|
|
878
|
-
gap_start=gap_start,
|
|
879
|
-
gap_end=gap_end,
|
|
878
|
+
self._heartbeat_monitor(protocol),
|
|
880
879
|
)
|
|
880
|
+
protocol.start()
|
|
881
|
+
|
|
882
|
+
if should_restart:
|
|
883
|
+
metadata = await protocol._metadata_received
|
|
884
|
+
gap_end = pd.Timestamp(metadata.start, tz="UTC")
|
|
885
|
+
logger.info(
|
|
886
|
+
"reconnected live session session_id='%s' with gap of %f second(s)",
|
|
887
|
+
self.session_id,
|
|
888
|
+
(gap_end - gap_start).total_seconds(),
|
|
889
|
+
)
|
|
890
|
+
self._dispatch_reconnect_callbacks(
|
|
891
|
+
gap_start=gap_start,
|
|
892
|
+
gap_end=gap_end,
|
|
893
|
+
)
|
|
894
|
+
else:
|
|
895
|
+
logger.info("reconnected live session session_id='%s'", self.session_id)
|
|
881
896
|
continue
|
|
882
897
|
else:
|
|
883
898
|
return
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.90.0"
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "databento"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.90.0"
|
|
4
4
|
description = "Official Python client library for Databento"
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
classifiers = [
|
|
10
10
|
"Development Status :: 4 - Beta",
|
|
11
11
|
"Operating System :: OS Independent",
|
|
12
12
|
"Programming Language :: Python :: 3",
|
|
13
|
-
"Programming Language :: Python :: 3.10",
|
|
14
13
|
"Programming Language :: Python :: 3.11",
|
|
15
14
|
"Programming Language :: Python :: 3.12",
|
|
16
15
|
"Programming Language :: Python :: 3.13",
|
|
17
16
|
"Programming Language :: Python :: 3.14",
|
|
17
|
+
"Programming Language :: Python :: 3.15",
|
|
18
18
|
"Topic :: Office/Business :: Financial",
|
|
19
19
|
"Topic :: Office/Business :: Financial :: Investment",
|
|
20
20
|
"Topic :: Software Development :: Libraries",
|
|
@@ -24,7 +24,7 @@ dependencies = [
|
|
|
24
24
|
"aiohttp>=3.8.3,<4.0.0; python_version < '3.12'",
|
|
25
25
|
"aiohttp>=3.9.0,<4.0.0; python_version >= '3.12'",
|
|
26
26
|
"certifi>=2026.10.19",
|
|
27
|
-
"databento-dbn~=0.
|
|
27
|
+
"databento-dbn~=0.73.0",
|
|
28
28
|
"numpy>=1.23.5; python_version < '3.12'",
|
|
29
29
|
"numpy>=1.26.0; python_version >= '3.12'",
|
|
30
30
|
"pandas>=1.5.3,<4.0.0",
|
|
@@ -52,7 +52,6 @@ dev = [
|
|
|
52
52
|
"pytest-asyncio>=1.2.0,<2",
|
|
53
53
|
"ruff>=0.15.12,<0.16",
|
|
54
54
|
"teamcity-messages>=1.32,<2",
|
|
55
|
-
"tomli>=2.0.1,<3",
|
|
56
55
|
"types-requests>=2.30.0,<3",
|
|
57
56
|
]
|
|
58
57
|
|
|
@@ -68,7 +67,7 @@ module-root = ""
|
|
|
68
67
|
line_length = 100
|
|
69
68
|
|
|
70
69
|
[tool.mypy]
|
|
71
|
-
python_version = "3.
|
|
70
|
+
python_version = "3.11"
|
|
72
71
|
disallow_untyped_defs = true
|
|
73
72
|
disallow_any_generics = true
|
|
74
73
|
disallow_subclassing_any = true
|
|
@@ -88,3 +87,4 @@ asyncio_default_test_loop_scope = "module"
|
|
|
88
87
|
|
|
89
88
|
[tool.ruff]
|
|
90
89
|
extend = "../ruff.toml"
|
|
90
|
+
target-version = "py311"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "databento"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.90.0"
|
|
4
4
|
description = "Official Python client library for Databento"
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
authors = [{ name = "Databento", email = "support@databento.com" }]
|
|
@@ -11,11 +11,11 @@ classifiers = [
|
|
|
11
11
|
"Development Status :: 4 - Beta",
|
|
12
12
|
"Operating System :: OS Independent",
|
|
13
13
|
"Programming Language :: Python :: 3",
|
|
14
|
-
"Programming Language :: Python :: 3.10",
|
|
15
14
|
"Programming Language :: Python :: 3.11",
|
|
16
15
|
"Programming Language :: Python :: 3.12",
|
|
17
16
|
"Programming Language :: Python :: 3.13",
|
|
18
17
|
"Programming Language :: Python :: 3.14",
|
|
18
|
+
"Programming Language :: Python :: 3.15",
|
|
19
19
|
"Topic :: Office/Business :: Financial",
|
|
20
20
|
"Topic :: Office/Business :: Financial :: Investment",
|
|
21
21
|
"Topic :: Software Development :: Libraries",
|
|
@@ -25,7 +25,7 @@ dependencies = [
|
|
|
25
25
|
"aiohttp>=3.8.3,<4.0.0; python_version < '3.12'",
|
|
26
26
|
"aiohttp>=3.9.0,<4.0.0; python_version >= '3.12'",
|
|
27
27
|
"certifi>=2026.10.19",
|
|
28
|
-
"databento-dbn~=0.
|
|
28
|
+
"databento-dbn~=0.73.0",
|
|
29
29
|
"numpy>=1.23.5; python_version < '3.12'",
|
|
30
30
|
"numpy>=1.26.0; python_version >= '3.12'",
|
|
31
31
|
"pandas>=1.5.3,<4.0.0",
|
|
@@ -49,7 +49,6 @@ dev = [
|
|
|
49
49
|
"pytest-asyncio>=1.2.0,<2",
|
|
50
50
|
"ruff>=0.15.12,<0.16",
|
|
51
51
|
"teamcity-messages>=1.32,<2",
|
|
52
|
-
"tomli>=2.0.1,<3",
|
|
53
52
|
"types-requests>=2.30.0,<3",
|
|
54
53
|
]
|
|
55
54
|
|
|
@@ -65,7 +64,7 @@ module-root = ""
|
|
|
65
64
|
line_length = 100
|
|
66
65
|
|
|
67
66
|
[tool.mypy]
|
|
68
|
-
python_version = "3.
|
|
67
|
+
python_version = "3.11"
|
|
69
68
|
disallow_untyped_defs = true
|
|
70
69
|
disallow_any_generics = true
|
|
71
70
|
disallow_subclassing_any = true
|
|
@@ -85,3 +84,4 @@ asyncio_default_test_loop_scope = "module"
|
|
|
85
84
|
|
|
86
85
|
[tool.ruff]
|
|
87
86
|
extend = "../ruff.toml"
|
|
87
|
+
target-version = "py311"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.89.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|