Skip to content

Commit 75d0f75

Browse files
ADD: DBN updates to support XNAS.BASIC
1 parent f80864b commit 75d0f75

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Added `mode` parameter to `DBNStore.to_json` to control the file writing mode
88
- Added `mode` parameter to `DBNStore.to_parquet` to control the file writing mode
99
- Added `compression` parameter to `DBNStore.to_file` which controls the output compression format
10+
- Added new consolidated publisher values for `XNAS.BASIC` and `DBEQ.MAX`
1011

1112
#### Breaking changes
1213
- Changed default write mode for `DBNStore.to_csv` to overwrite ("w")

databento/common/publishers.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,10 @@ class Publisher(StringyMixin, str, Enum):
955955
NYSE National BBO and Trades.
956956
XNYS_BBOTRADES_XNYS
957957
NYSE BBO and Trades.
958+
XNAS_BASIC_DBEQ
959+
Nasdaq Basic - Consolidated.
960+
DBEQ_MAX_DBEQ
961+
DBEQ Max - Consolidated.
958962
959963
"""
960964

@@ -1050,6 +1054,8 @@ class Publisher(StringyMixin, str, Enum):
10501054
DBEQ_SUMMARY_DBEQ = "DBEQ.SUMMARY.DBEQ"
10511055
XCIS_BBOTRADES_XCIS = "XCIS.BBOTRADES.XCIS"
10521056
XNYS_BBOTRADES_XNYS = "XNYS.BBOTRADES.XNYS"
1057+
XNAS_BASIC_DBEQ = "XNAS.BASIC.DBEQ"
1058+
DBEQ_MAX_DBEQ = "DBEQ.MAX.DBEQ"
10531059

10541060
@classmethod
10551061
def from_int(cls, value: int) -> Publisher:
@@ -1240,6 +1246,10 @@ def from_int(cls, value: int) -> Publisher:
12401246
return Publisher.XCIS_BBOTRADES_XCIS
12411247
if value == 92:
12421248
return Publisher.XNYS_BBOTRADES_XNYS
1249+
if value == 93:
1250+
return Publisher.XNAS_BASIC_DBEQ
1251+
if value == 94:
1252+
return Publisher.DBEQ_MAX_DBEQ
12431253
raise ValueError(f"Integer value {value} does not correspond with any Publisher variant")
12441254

12451255
def to_int(self) -> int:
@@ -1430,6 +1440,10 @@ def to_int(self) -> int:
14301440
return 91
14311441
if self == Publisher.XNYS_BBOTRADES_XNYS:
14321442
return 92
1443+
if self == Publisher.XNAS_BASIC_DBEQ:
1444+
return 93
1445+
if self == Publisher.DBEQ_MAX_DBEQ:
1446+
return 94
14331447
raise ValueError("Invalid Publisher")
14341448

14351449
@property
@@ -1621,6 +1635,10 @@ def venue(self) -> Venue:
16211635
return Venue.XCIS
16221636
if self == Publisher.XNYS_BBOTRADES_XNYS:
16231637
return Venue.XNYS
1638+
if self == Publisher.XNAS_BASIC_DBEQ:
1639+
return Venue.DBEQ
1640+
if self == Publisher.DBEQ_MAX_DBEQ:
1641+
return Venue.DBEQ
16241642
raise ValueError("Unexpected Publisher value")
16251643

16261644
@property
@@ -1812,6 +1830,10 @@ def dataset(self) -> Dataset:
18121830
return Dataset.XCIS_BBOTRADES
18131831
if self == Publisher.XNYS_BBOTRADES_XNYS:
18141832
return Dataset.XNYS_BBOTRADES
1833+
if self == Publisher.XNAS_BASIC_DBEQ:
1834+
return Dataset.XNAS_BASIC
1835+
if self == Publisher.DBEQ_MAX_DBEQ:
1836+
return Dataset.DBEQ_MAX
18151837
raise ValueError("Unexpected Publisher value")
18161838

18171839
@property
@@ -2003,4 +2025,8 @@ def description(self) -> str:
20032025
return "NYSE National BBO and Trades"
20042026
if self == Publisher.XNYS_BBOTRADES_XNYS:
20052027
return "NYSE BBO and Trades"
2028+
if self == Publisher.XNAS_BASIC_DBEQ:
2029+
return "Nasdaq Basic - Consolidated"
2030+
if self == Publisher.DBEQ_MAX_DBEQ:
2031+
return "DBEQ Max - Consolidated"
20062032
raise ValueError("Unexpected Publisher value")

0 commit comments

Comments
 (0)