Skip to content

Commit 5243ae8

Browse files
ADD: Add XNAS.BASIC publishers
1 parent 7215e0e commit 5243ae8

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

databento/common/publishers.py

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@ class Dataset(StringyMixin, str, Enum):
485485
ICE Endex iMpact.
486486
DBEQ_MAX
487487
Databento Equities Max.
488+
XNAS_BASIC
489+
Nasdaq Basic (NLS+QBBO).
488490
489491
"""
490492

@@ -518,6 +520,7 @@ class Dataset(StringyMixin, str, Enum):
518520
IFEU_IMPACT = "IFEU.IMPACT"
519521
NDEX_IMPACT = "NDEX.IMPACT"
520522
DBEQ_MAX = "DBEQ.MAX"
523+
XNAS_BASIC = "XNAS.BASIC"
521524

522525
@classmethod
523526
def from_int(cls, value: int) -> Dataset:
@@ -584,6 +587,8 @@ def from_int(cls, value: int) -> Dataset:
584587
return Dataset.NDEX_IMPACT
585588
if value == 30:
586589
return Dataset.DBEQ_MAX
590+
if value == 31:
591+
return Dataset.XNAS_BASIC
587592
raise ValueError(f"Integer value {value} does not correspond with any Dataset variant")
588593

589594
def to_int(self) -> int:
@@ -650,6 +655,8 @@ def to_int(self) -> int:
650655
return 29
651656
if self == Dataset.DBEQ_MAX:
652657
return 30
658+
if self == Dataset.XNAS_BASIC:
659+
return 31
653660
raise ValueError("Invalid Dataset")
654661

655662
@property
@@ -717,6 +724,8 @@ def description(self) -> str:
717724
return "ICE Endex iMpact"
718725
if self == Dataset.DBEQ_MAX:
719726
return "Databento Equities Max"
727+
if self == Dataset.XNAS_BASIC:
728+
return "Nasdaq Basic (NLS+QBBO)"
720729
raise ValueError("Unexpected Dataset value")
721730

722731

@@ -833,9 +842,9 @@ class Publisher(StringyMixin, str, Enum):
833842
DBEQ_PLUS_XNYS
834843
DBEQ Plus - NYSE.
835844
DBEQ_PLUS_FINN
836-
DBEQ Plus - FINRA/NYSE TRF.
837-
DBEQ_PLUS_FINY
838845
DBEQ Plus - FINRA/Nasdaq TRF Carteret.
846+
DBEQ_PLUS_FINY
847+
DBEQ Plus - FINRA/NYSE TRF.
839848
DBEQ_PLUS_FINC
840849
DBEQ Plus - FINRA/Nasdaq TRF Chicago.
841850
IFEU_IMPACT_IFEU
@@ -861,9 +870,9 @@ class Publisher(StringyMixin, str, Enum):
861870
DBEQ_MAX_XNYS
862871
DBEQ Max - NYSE.
863872
DBEQ_MAX_FINN
864-
DBEQ Max - FINRA/NYSE TRF.
865-
DBEQ_MAX_FINY
866873
DBEQ Max - FINRA/Nasdaq TRF Carteret.
874+
DBEQ_MAX_FINY
875+
DBEQ Max - FINRA/NYSE TRF.
867876
DBEQ_MAX_FINC
868877
DBEQ Max - FINRA/Nasdaq TRF Chicago.
869878
DBEQ_MAX_BATS
@@ -886,6 +895,12 @@ class Publisher(StringyMixin, str, Enum):
886895
DBEQ Max - NYSE Arca.
887896
DBEQ_MAX_LTSE
888897
DBEQ Max - Long-Term Stock Exchange.
898+
XNAS_BASIC_XNAS
899+
Nasdaq Basic - Nasdaq.
900+
XNAS_BASIC_FINN
901+
Nasdaq Basic - FINRA/Nasdaq TRF Carteret.
902+
XNAS_BASIC_FINC
903+
Nasdaq Basic - FINRA/Nasdaq TRF Chicago.
889904
890905
"""
891906

@@ -969,6 +984,9 @@ class Publisher(StringyMixin, str, Enum):
969984
DBEQ_MAX_XASE = "DBEQ.MAX.XASE"
970985
DBEQ_MAX_ARCX = "DBEQ.MAX.ARCX"
971986
DBEQ_MAX_LTSE = "DBEQ.MAX.LTSE"
987+
XNAS_BASIC_XNAS = "XNAS.BASIC.XNAS"
988+
XNAS_BASIC_FINN = "XNAS.BASIC.FINN"
989+
XNAS_BASIC_FINC = "XNAS.BASIC.FINC"
972990

973991
@classmethod
974992
def from_int(cls, value: int) -> Publisher:
@@ -1135,6 +1153,12 @@ def from_int(cls, value: int) -> Publisher:
11351153
return Publisher.DBEQ_MAX_ARCX
11361154
if value == 80:
11371155
return Publisher.DBEQ_MAX_LTSE
1156+
if value == 81:
1157+
return Publisher.XNAS_BASIC_XNAS
1158+
if value == 82:
1159+
return Publisher.XNAS_BASIC_FINN
1160+
if value == 83:
1161+
return Publisher.XNAS_BASIC_FINC
11381162
raise ValueError(f"Integer value {value} does not correspond with any Publisher variant")
11391163

11401164
def to_int(self) -> int:
@@ -1301,6 +1325,12 @@ def to_int(self) -> int:
13011325
return 79
13021326
if self == Publisher.DBEQ_MAX_LTSE:
13031327
return 80
1328+
if self == Publisher.XNAS_BASIC_XNAS:
1329+
return 81
1330+
if self == Publisher.XNAS_BASIC_FINN:
1331+
return 82
1332+
if self == Publisher.XNAS_BASIC_FINC:
1333+
return 83
13041334
raise ValueError("Invalid Publisher")
13051335

13061336
@property
@@ -1468,6 +1498,12 @@ def venue(self) -> Venue:
14681498
return Venue.ARCX
14691499
if self == Publisher.DBEQ_MAX_LTSE:
14701500
return Venue.LTSE
1501+
if self == Publisher.XNAS_BASIC_XNAS:
1502+
return Venue.XNAS
1503+
if self == Publisher.XNAS_BASIC_FINN:
1504+
return Venue.FINN
1505+
if self == Publisher.XNAS_BASIC_FINC:
1506+
return Venue.FINC
14711507
raise ValueError("Unexpected Publisher value")
14721508

14731509
@property
@@ -1635,6 +1671,12 @@ def dataset(self) -> Dataset:
16351671
return Dataset.DBEQ_MAX
16361672
if self == Publisher.DBEQ_MAX_LTSE:
16371673
return Dataset.DBEQ_MAX
1674+
if self == Publisher.XNAS_BASIC_XNAS:
1675+
return Dataset.XNAS_BASIC
1676+
if self == Publisher.XNAS_BASIC_FINN:
1677+
return Dataset.XNAS_BASIC
1678+
if self == Publisher.XNAS_BASIC_FINC:
1679+
return Dataset.XNAS_BASIC
16381680
raise ValueError("Unexpected Publisher value")
16391681

16401682
@property
@@ -1749,9 +1791,9 @@ def description(self) -> str:
17491791
if self == Publisher.DBEQ_PLUS_XNYS:
17501792
return "DBEQ Plus - NYSE"
17511793
if self == Publisher.DBEQ_PLUS_FINN:
1752-
return "DBEQ Plus - FINRA/NYSE TRF"
1753-
if self == Publisher.DBEQ_PLUS_FINY:
17541794
return "DBEQ Plus - FINRA/Nasdaq TRF Carteret"
1795+
if self == Publisher.DBEQ_PLUS_FINY:
1796+
return "DBEQ Plus - FINRA/NYSE TRF"
17551797
if self == Publisher.DBEQ_PLUS_FINC:
17561798
return "DBEQ Plus - FINRA/Nasdaq TRF Chicago"
17571799
if self == Publisher.IFEU_IMPACT_IFEU:
@@ -1777,9 +1819,9 @@ def description(self) -> str:
17771819
if self == Publisher.DBEQ_MAX_XNYS:
17781820
return "DBEQ Max - NYSE"
17791821
if self == Publisher.DBEQ_MAX_FINN:
1780-
return "DBEQ Max - FINRA/NYSE TRF"
1781-
if self == Publisher.DBEQ_MAX_FINY:
17821822
return "DBEQ Max - FINRA/Nasdaq TRF Carteret"
1823+
if self == Publisher.DBEQ_MAX_FINY:
1824+
return "DBEQ Max - FINRA/NYSE TRF"
17831825
if self == Publisher.DBEQ_MAX_FINC:
17841826
return "DBEQ Max - FINRA/Nasdaq TRF Chicago"
17851827
if self == Publisher.DBEQ_MAX_BATS:
@@ -1802,4 +1844,10 @@ def description(self) -> str:
18021844
return "DBEQ Max - NYSE Arca"
18031845
if self == Publisher.DBEQ_MAX_LTSE:
18041846
return "DBEQ Max - Long-Term Stock Exchange"
1847+
if self == Publisher.XNAS_BASIC_XNAS:
1848+
return "Nasdaq Basic - Nasdaq"
1849+
if self == Publisher.XNAS_BASIC_FINN:
1850+
return "Nasdaq Basic - FINRA/Nasdaq TRF Carteret"
1851+
if self == Publisher.XNAS_BASIC_FINC:
1852+
return "Nasdaq Basic - FINRA/Nasdaq TRF Chicago"
18051853
raise ValueError("Unexpected Publisher value")

0 commit comments

Comments
 (0)