Skip to content

Commit 2f2078e

Browse files
authored
Release 0.35.0
See release notes.
2 parents 8b9ac5a + 282b62c commit 2f2078e

File tree

16 files changed

+224
-60
lines changed

16 files changed

+224
-60
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.35.0 - 2024-06-04
4+
5+
#### Enhancements
6+
- Added optional `heartbeat_interval_s` parameter to `Live` client for configuring the
7+
interval at which the gateway will send heartbeat records
8+
- Upgraded `databento-dbn` to 0.18.0
9+
- Added new off-market publisher values for `IFEU.IMPACT` and `NDEX.IMPACT`
10+
11+
#### Breaking changes
12+
- Renamed `CbboMsg` to `CBBOMsg`.
13+
- Renamed `use_snapshot` parameter in `Live.subscribe` function to `snapshot`
14+
- All Python exceptions raised by `databento-dbn` have been changed to use the `DBNError` type
15+
316
## 0.34.1 - 2024-05-21
417

518
#### Enhancements
@@ -9,7 +22,7 @@
922

1023
#### Enhancements
1124
- Added `pip-system-certs` dependency for Windows platforms to prevent a connection issue in `requests` when behind a proxy
12-
- Iteration of the `Live` client will now automatically call `Live.stop` when the iterator is destroyed, such as when a for loop is escaped with an exception or `break` statement.
25+
- Iteration of the `Live` client will now automatically call `Live.stop` when the iterator is destroyed, such as when a for loop is escaped with an exception or `break` statement
1326

1427
#### Bug fixes
1528
- Fixed an issue where `batch.download` and `batch.download_async` would fail if requested files already existed in the output directory

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.17.1"
35+
- databento-dbn = "0.18.0"
3636
- numpy= ">=1.23.5"
3737
- pandas = ">=1.5.3"
3838
- pip-system-certs = ">=4.0" (Windows only)

databento/common/constants.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Final
44

55
import numpy as np
6-
from databento_dbn import CbboMsg
6+
from databento_dbn import CBBOMsg
77
from databento_dbn import ImbalanceMsg
88
from databento_dbn import InstrumentDefMsg
99
from databento_dbn import InstrumentDefMsgV1
@@ -41,10 +41,10 @@
4141
Schema.STATISTICS: StatMsg,
4242
Schema.TBBO: MBP1Msg,
4343
Schema.TRADES: TradeMsg,
44-
Schema.CBBO: CbboMsg,
45-
Schema.CBBO_1S: CbboMsg,
46-
Schema.CBBO_1M: CbboMsg,
47-
Schema.TCBBO: CbboMsg,
44+
Schema.CBBO: CBBOMsg,
45+
Schema.CBBO_1S: CBBOMsg,
46+
Schema.CBBO_1M: CBBOMsg,
47+
Schema.TCBBO: CBBOMsg,
4848
Schema.BBO_1S: MBP1Msg,
4949
Schema.BBO_1M: MBP1Msg,
5050
}

databento/common/publishers.py

Lines changed: 91 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class Venue(StringyMixin, str, Enum):
100100
MIAX Sapphire.
101101
LTSE
102102
Long-Term Stock Exchange, Inc..
103+
XOFF
104+
Off-Exchange Transactions - Listed Instruments.
103105
104106
"""
105107

@@ -145,6 +147,7 @@ class Venue(StringyMixin, str, Enum):
145147
DBEQ = "DBEQ"
146148
SPHR = "SPHR"
147149
LTSE = "LTSE"
150+
XOFF = "XOFF"
148151

149152
@classmethod
150153
def from_int(cls, value: int) -> Venue:
@@ -235,6 +238,8 @@ def from_int(cls, value: int) -> Venue:
235238
return Venue.SPHR
236239
if value == 42:
237240
return Venue.LTSE
241+
if value == 43:
242+
return Venue.XOFF
238243
raise ValueError(f"Integer value {value} does not correspond with any Venue variant")
239244

240245
def to_int(self) -> int:
@@ -325,6 +330,8 @@ def to_int(self) -> int:
325330
return 41
326331
if self == Venue.LTSE:
327332
return 42
333+
if self == Venue.XOFF:
334+
return 43
328335
raise ValueError("Invalid Venue")
329336

330337
@property
@@ -416,6 +423,8 @@ def description(self) -> str:
416423
return "MIAX Sapphire"
417424
if self == Venue.LTSE:
418425
return "Long-Term Stock Exchange, Inc."
426+
if self == Venue.XOFF:
427+
return "Off-Exchange Transactions - Listed Instruments"
419428
raise ValueError("Unexpected Venue value")
420429

421430

@@ -485,6 +494,8 @@ class Dataset(StringyMixin, str, Enum):
485494
ICE Endex iMpact.
486495
DBEQ_MAX
487496
Databento Equities Max.
497+
XNAS_BASIC
498+
Nasdaq Basic (NLS+QBBO).
488499
489500
"""
490501

@@ -518,6 +529,7 @@ class Dataset(StringyMixin, str, Enum):
518529
IFEU_IMPACT = "IFEU.IMPACT"
519530
NDEX_IMPACT = "NDEX.IMPACT"
520531
DBEQ_MAX = "DBEQ.MAX"
532+
XNAS_BASIC = "XNAS.BASIC"
521533

522534
@classmethod
523535
def from_int(cls, value: int) -> Dataset:
@@ -584,6 +596,8 @@ def from_int(cls, value: int) -> Dataset:
584596
return Dataset.NDEX_IMPACT
585597
if value == 30:
586598
return Dataset.DBEQ_MAX
599+
if value == 31:
600+
return Dataset.XNAS_BASIC
587601
raise ValueError(f"Integer value {value} does not correspond with any Dataset variant")
588602

589603
def to_int(self) -> int:
@@ -650,6 +664,8 @@ def to_int(self) -> int:
650664
return 29
651665
if self == Dataset.DBEQ_MAX:
652666
return 30
667+
if self == Dataset.XNAS_BASIC:
668+
return 31
653669
raise ValueError("Invalid Dataset")
654670

655671
@property
@@ -717,6 +733,8 @@ def description(self) -> str:
717733
return "ICE Endex iMpact"
718734
if self == Dataset.DBEQ_MAX:
719735
return "Databento Equities Max"
736+
if self == Dataset.XNAS_BASIC:
737+
return "Nasdaq Basic (NLS+QBBO)"
720738
raise ValueError("Unexpected Dataset value")
721739

722740

@@ -833,9 +851,9 @@ class Publisher(StringyMixin, str, Enum):
833851
DBEQ_PLUS_XNYS
834852
DBEQ Plus - NYSE.
835853
DBEQ_PLUS_FINN
836-
DBEQ Plus - FINRA/NYSE TRF.
837-
DBEQ_PLUS_FINY
838854
DBEQ Plus - FINRA/Nasdaq TRF Carteret.
855+
DBEQ_PLUS_FINY
856+
DBEQ Plus - FINRA/NYSE TRF.
839857
DBEQ_PLUS_FINC
840858
DBEQ Plus - FINRA/Nasdaq TRF Chicago.
841859
IFEU_IMPACT_IFEU
@@ -861,9 +879,9 @@ class Publisher(StringyMixin, str, Enum):
861879
DBEQ_MAX_XNYS
862880
DBEQ Max - NYSE.
863881
DBEQ_MAX_FINN
864-
DBEQ Max - FINRA/NYSE TRF.
865-
DBEQ_MAX_FINY
866882
DBEQ Max - FINRA/Nasdaq TRF Carteret.
883+
DBEQ_MAX_FINY
884+
DBEQ Max - FINRA/NYSE TRF.
867885
DBEQ_MAX_FINC
868886
DBEQ Max - FINRA/Nasdaq TRF Chicago.
869887
DBEQ_MAX_BATS
@@ -886,6 +904,16 @@ class Publisher(StringyMixin, str, Enum):
886904
DBEQ Max - NYSE Arca.
887905
DBEQ_MAX_LTSE
888906
DBEQ Max - Long-Term Stock Exchange.
907+
XNAS_BASIC_XNAS
908+
Nasdaq Basic - Nasdaq.
909+
XNAS_BASIC_FINN
910+
Nasdaq Basic - FINRA/Nasdaq TRF Carteret.
911+
XNAS_BASIC_FINC
912+
Nasdaq Basic - FINRA/Nasdaq TRF Chicago.
913+
IFEU_IMPACT_XOFF
914+
ICE Futures Europe - Off-Market Trades.
915+
NDEX_IMPACT_XOFF
916+
ICE Endex - Off-Market Trades.
889917
890918
"""
891919

@@ -969,6 +997,11 @@ class Publisher(StringyMixin, str, Enum):
969997
DBEQ_MAX_XASE = "DBEQ.MAX.XASE"
970998
DBEQ_MAX_ARCX = "DBEQ.MAX.ARCX"
971999
DBEQ_MAX_LTSE = "DBEQ.MAX.LTSE"
1000+
XNAS_BASIC_XNAS = "XNAS.BASIC.XNAS"
1001+
XNAS_BASIC_FINN = "XNAS.BASIC.FINN"
1002+
XNAS_BASIC_FINC = "XNAS.BASIC.FINC"
1003+
IFEU_IMPACT_XOFF = "IFEU.IMPACT.XOFF"
1004+
NDEX_IMPACT_XOFF = "NDEX.IMPACT.XOFF"
9721005

9731006
@classmethod
9741007
def from_int(cls, value: int) -> Publisher:
@@ -1135,6 +1168,16 @@ def from_int(cls, value: int) -> Publisher:
11351168
return Publisher.DBEQ_MAX_ARCX
11361169
if value == 80:
11371170
return Publisher.DBEQ_MAX_LTSE
1171+
if value == 81:
1172+
return Publisher.XNAS_BASIC_XNAS
1173+
if value == 82:
1174+
return Publisher.XNAS_BASIC_FINN
1175+
if value == 83:
1176+
return Publisher.XNAS_BASIC_FINC
1177+
if value == 84:
1178+
return Publisher.IFEU_IMPACT_XOFF
1179+
if value == 85:
1180+
return Publisher.NDEX_IMPACT_XOFF
11381181
raise ValueError(f"Integer value {value} does not correspond with any Publisher variant")
11391182

11401183
def to_int(self) -> int:
@@ -1301,6 +1344,16 @@ def to_int(self) -> int:
13011344
return 79
13021345
if self == Publisher.DBEQ_MAX_LTSE:
13031346
return 80
1347+
if self == Publisher.XNAS_BASIC_XNAS:
1348+
return 81
1349+
if self == Publisher.XNAS_BASIC_FINN:
1350+
return 82
1351+
if self == Publisher.XNAS_BASIC_FINC:
1352+
return 83
1353+
if self == Publisher.IFEU_IMPACT_XOFF:
1354+
return 84
1355+
if self == Publisher.NDEX_IMPACT_XOFF:
1356+
return 85
13041357
raise ValueError("Invalid Publisher")
13051358

13061359
@property
@@ -1468,6 +1521,16 @@ def venue(self) -> Venue:
14681521
return Venue.ARCX
14691522
if self == Publisher.DBEQ_MAX_LTSE:
14701523
return Venue.LTSE
1524+
if self == Publisher.XNAS_BASIC_XNAS:
1525+
return Venue.XNAS
1526+
if self == Publisher.XNAS_BASIC_FINN:
1527+
return Venue.FINN
1528+
if self == Publisher.XNAS_BASIC_FINC:
1529+
return Venue.FINC
1530+
if self == Publisher.IFEU_IMPACT_XOFF:
1531+
return Venue.XOFF
1532+
if self == Publisher.NDEX_IMPACT_XOFF:
1533+
return Venue.XOFF
14711534
raise ValueError("Unexpected Publisher value")
14721535

14731536
@property
@@ -1635,6 +1698,16 @@ def dataset(self) -> Dataset:
16351698
return Dataset.DBEQ_MAX
16361699
if self == Publisher.DBEQ_MAX_LTSE:
16371700
return Dataset.DBEQ_MAX
1701+
if self == Publisher.XNAS_BASIC_XNAS:
1702+
return Dataset.XNAS_BASIC
1703+
if self == Publisher.XNAS_BASIC_FINN:
1704+
return Dataset.XNAS_BASIC
1705+
if self == Publisher.XNAS_BASIC_FINC:
1706+
return Dataset.XNAS_BASIC
1707+
if self == Publisher.IFEU_IMPACT_XOFF:
1708+
return Dataset.IFEU_IMPACT
1709+
if self == Publisher.NDEX_IMPACT_XOFF:
1710+
return Dataset.NDEX_IMPACT
16381711
raise ValueError("Unexpected Publisher value")
16391712

16401713
@property
@@ -1749,9 +1822,9 @@ def description(self) -> str:
17491822
if self == Publisher.DBEQ_PLUS_XNYS:
17501823
return "DBEQ Plus - NYSE"
17511824
if self == Publisher.DBEQ_PLUS_FINN:
1752-
return "DBEQ Plus - FINRA/NYSE TRF"
1753-
if self == Publisher.DBEQ_PLUS_FINY:
17541825
return "DBEQ Plus - FINRA/Nasdaq TRF Carteret"
1826+
if self == Publisher.DBEQ_PLUS_FINY:
1827+
return "DBEQ Plus - FINRA/NYSE TRF"
17551828
if self == Publisher.DBEQ_PLUS_FINC:
17561829
return "DBEQ Plus - FINRA/Nasdaq TRF Chicago"
17571830
if self == Publisher.IFEU_IMPACT_IFEU:
@@ -1777,9 +1850,9 @@ def description(self) -> str:
17771850
if self == Publisher.DBEQ_MAX_XNYS:
17781851
return "DBEQ Max - NYSE"
17791852
if self == Publisher.DBEQ_MAX_FINN:
1780-
return "DBEQ Max - FINRA/NYSE TRF"
1781-
if self == Publisher.DBEQ_MAX_FINY:
17821853
return "DBEQ Max - FINRA/Nasdaq TRF Carteret"
1854+
if self == Publisher.DBEQ_MAX_FINY:
1855+
return "DBEQ Max - FINRA/NYSE TRF"
17831856
if self == Publisher.DBEQ_MAX_FINC:
17841857
return "DBEQ Max - FINRA/Nasdaq TRF Chicago"
17851858
if self == Publisher.DBEQ_MAX_BATS:
@@ -1802,4 +1875,14 @@ def description(self) -> str:
18021875
return "DBEQ Max - NYSE Arca"
18031876
if self == Publisher.DBEQ_MAX_LTSE:
18041877
return "DBEQ Max - Long-Term Stock Exchange"
1878+
if self == Publisher.XNAS_BASIC_XNAS:
1879+
return "Nasdaq Basic - Nasdaq"
1880+
if self == Publisher.XNAS_BASIC_FINN:
1881+
return "Nasdaq Basic - FINRA/Nasdaq TRF Carteret"
1882+
if self == Publisher.XNAS_BASIC_FINC:
1883+
return "Nasdaq Basic - FINRA/Nasdaq TRF Chicago"
1884+
if self == Publisher.IFEU_IMPACT_XOFF:
1885+
return "ICE Futures Europe - Off-Market Trades"
1886+
if self == Publisher.NDEX_IMPACT_XOFF:
1887+
return "ICE Endex - Off-Market Trades"
18051888
raise ValueError("Unexpected Publisher value")

databento/common/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
DBNRecord = Union[
12-
databento_dbn.CbboMsg,
12+
databento_dbn.CBBOMsg,
1313
databento_dbn.MBOMsg,
1414
databento_dbn.MBP1Msg,
1515
databento_dbn.MBP10Msg,

databento/common/validation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from urllib.parse import urlsplit
99
from urllib.parse import urlunsplit
1010

11+
from databento_dbn import DBNError
12+
1113

1214
E = TypeVar("E", bound=Enum)
1315

@@ -109,7 +111,7 @@ def validate_enum(
109111
"""
110112
try:
111113
return enum(value)
112-
except ValueError:
114+
except (ValueError, DBNError):
113115
if hasattr(enum, "variants"):
114116
valid = list(map(str, enum.variants())) # type: ignore [attr-defined]
115117
else:

databento/historical/http.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def _check_api_key(self) -> None:
4646
if self._key == "YOUR_API_KEY":
4747
raise ValueError(
4848
"The API key is currently set to 'YOUR_API_KEY'. "
49-
"Please replace this value with a valid API key. "
50-
"You can find these through your Databento user portal.",
49+
"Please replace this value with a key from your user portal https://databento.com/portal/keys",
5150
)
5251

5352
def _get(

0 commit comments

Comments
 (0)