Skip to content

Commit

Permalink
ADD: Add XNAS.BASIC publishers
Browse files Browse the repository at this point in the history
  • Loading branch information
renan-databento committed May 27, 2024
1 parent 7215e0e commit 5243ae8
Showing 1 changed file with 56 additions and 8 deletions.
64 changes: 56 additions & 8 deletions databento/common/publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ class Dataset(StringyMixin, str, Enum):
ICE Endex iMpact.
DBEQ_MAX
Databento Equities Max.
XNAS_BASIC
Nasdaq Basic (NLS+QBBO).
"""

Expand Down Expand Up @@ -518,6 +520,7 @@ class Dataset(StringyMixin, str, Enum):
IFEU_IMPACT = "IFEU.IMPACT"
NDEX_IMPACT = "NDEX.IMPACT"
DBEQ_MAX = "DBEQ.MAX"
XNAS_BASIC = "XNAS.BASIC"

@classmethod
def from_int(cls, value: int) -> Dataset:
Expand Down Expand Up @@ -584,6 +587,8 @@ def from_int(cls, value: int) -> Dataset:
return Dataset.NDEX_IMPACT
if value == 30:
return Dataset.DBEQ_MAX
if value == 31:
return Dataset.XNAS_BASIC
raise ValueError(f"Integer value {value} does not correspond with any Dataset variant")

def to_int(self) -> int:
Expand Down Expand Up @@ -650,6 +655,8 @@ def to_int(self) -> int:
return 29
if self == Dataset.DBEQ_MAX:
return 30
if self == Dataset.XNAS_BASIC:
return 31
raise ValueError("Invalid Dataset")

@property
Expand Down Expand Up @@ -717,6 +724,8 @@ def description(self) -> str:
return "ICE Endex iMpact"
if self == Dataset.DBEQ_MAX:
return "Databento Equities Max"
if self == Dataset.XNAS_BASIC:
return "Nasdaq Basic (NLS+QBBO)"
raise ValueError("Unexpected Dataset value")


Expand Down Expand Up @@ -833,9 +842,9 @@ class Publisher(StringyMixin, str, Enum):
DBEQ_PLUS_XNYS
DBEQ Plus - NYSE.
DBEQ_PLUS_FINN
DBEQ Plus - FINRA/NYSE TRF.
DBEQ_PLUS_FINY
DBEQ Plus - FINRA/Nasdaq TRF Carteret.
DBEQ_PLUS_FINY
DBEQ Plus - FINRA/NYSE TRF.
DBEQ_PLUS_FINC
DBEQ Plus - FINRA/Nasdaq TRF Chicago.
IFEU_IMPACT_IFEU
Expand All @@ -861,9 +870,9 @@ class Publisher(StringyMixin, str, Enum):
DBEQ_MAX_XNYS
DBEQ Max - NYSE.
DBEQ_MAX_FINN
DBEQ Max - FINRA/NYSE TRF.
DBEQ_MAX_FINY
DBEQ Max - FINRA/Nasdaq TRF Carteret.
DBEQ_MAX_FINY
DBEQ Max - FINRA/NYSE TRF.
DBEQ_MAX_FINC
DBEQ Max - FINRA/Nasdaq TRF Chicago.
DBEQ_MAX_BATS
Expand All @@ -886,6 +895,12 @@ class Publisher(StringyMixin, str, Enum):
DBEQ Max - NYSE Arca.
DBEQ_MAX_LTSE
DBEQ Max - Long-Term Stock Exchange.
XNAS_BASIC_XNAS
Nasdaq Basic - Nasdaq.
XNAS_BASIC_FINN
Nasdaq Basic - FINRA/Nasdaq TRF Carteret.
XNAS_BASIC_FINC
Nasdaq Basic - FINRA/Nasdaq TRF Chicago.
"""

Expand Down Expand Up @@ -969,6 +984,9 @@ class Publisher(StringyMixin, str, Enum):
DBEQ_MAX_XASE = "DBEQ.MAX.XASE"
DBEQ_MAX_ARCX = "DBEQ.MAX.ARCX"
DBEQ_MAX_LTSE = "DBEQ.MAX.LTSE"
XNAS_BASIC_XNAS = "XNAS.BASIC.XNAS"
XNAS_BASIC_FINN = "XNAS.BASIC.FINN"
XNAS_BASIC_FINC = "XNAS.BASIC.FINC"

@classmethod
def from_int(cls, value: int) -> Publisher:
Expand Down Expand Up @@ -1135,6 +1153,12 @@ def from_int(cls, value: int) -> Publisher:
return Publisher.DBEQ_MAX_ARCX
if value == 80:
return Publisher.DBEQ_MAX_LTSE
if value == 81:
return Publisher.XNAS_BASIC_XNAS
if value == 82:
return Publisher.XNAS_BASIC_FINN
if value == 83:
return Publisher.XNAS_BASIC_FINC
raise ValueError(f"Integer value {value} does not correspond with any Publisher variant")

def to_int(self) -> int:
Expand Down Expand Up @@ -1301,6 +1325,12 @@ def to_int(self) -> int:
return 79
if self == Publisher.DBEQ_MAX_LTSE:
return 80
if self == Publisher.XNAS_BASIC_XNAS:
return 81
if self == Publisher.XNAS_BASIC_FINN:
return 82
if self == Publisher.XNAS_BASIC_FINC:
return 83
raise ValueError("Invalid Publisher")

@property
Expand Down Expand Up @@ -1468,6 +1498,12 @@ def venue(self) -> Venue:
return Venue.ARCX
if self == Publisher.DBEQ_MAX_LTSE:
return Venue.LTSE
if self == Publisher.XNAS_BASIC_XNAS:
return Venue.XNAS
if self == Publisher.XNAS_BASIC_FINN:
return Venue.FINN
if self == Publisher.XNAS_BASIC_FINC:
return Venue.FINC
raise ValueError("Unexpected Publisher value")

@property
Expand Down Expand Up @@ -1635,6 +1671,12 @@ def dataset(self) -> Dataset:
return Dataset.DBEQ_MAX
if self == Publisher.DBEQ_MAX_LTSE:
return Dataset.DBEQ_MAX
if self == Publisher.XNAS_BASIC_XNAS:
return Dataset.XNAS_BASIC
if self == Publisher.XNAS_BASIC_FINN:
return Dataset.XNAS_BASIC
if self == Publisher.XNAS_BASIC_FINC:
return Dataset.XNAS_BASIC
raise ValueError("Unexpected Publisher value")

@property
Expand Down Expand Up @@ -1749,9 +1791,9 @@ def description(self) -> str:
if self == Publisher.DBEQ_PLUS_XNYS:
return "DBEQ Plus - NYSE"
if self == Publisher.DBEQ_PLUS_FINN:
return "DBEQ Plus - FINRA/NYSE TRF"
if self == Publisher.DBEQ_PLUS_FINY:
return "DBEQ Plus - FINRA/Nasdaq TRF Carteret"
if self == Publisher.DBEQ_PLUS_FINY:
return "DBEQ Plus - FINRA/NYSE TRF"
if self == Publisher.DBEQ_PLUS_FINC:
return "DBEQ Plus - FINRA/Nasdaq TRF Chicago"
if self == Publisher.IFEU_IMPACT_IFEU:
Expand All @@ -1777,9 +1819,9 @@ def description(self) -> str:
if self == Publisher.DBEQ_MAX_XNYS:
return "DBEQ Max - NYSE"
if self == Publisher.DBEQ_MAX_FINN:
return "DBEQ Max - FINRA/NYSE TRF"
if self == Publisher.DBEQ_MAX_FINY:
return "DBEQ Max - FINRA/Nasdaq TRF Carteret"
if self == Publisher.DBEQ_MAX_FINY:
return "DBEQ Max - FINRA/NYSE TRF"
if self == Publisher.DBEQ_MAX_FINC:
return "DBEQ Max - FINRA/Nasdaq TRF Chicago"
if self == Publisher.DBEQ_MAX_BATS:
Expand All @@ -1802,4 +1844,10 @@ def description(self) -> str:
return "DBEQ Max - NYSE Arca"
if self == Publisher.DBEQ_MAX_LTSE:
return "DBEQ Max - Long-Term Stock Exchange"
if self == Publisher.XNAS_BASIC_XNAS:
return "Nasdaq Basic - Nasdaq"
if self == Publisher.XNAS_BASIC_FINN:
return "Nasdaq Basic - FINRA/Nasdaq TRF Carteret"
if self == Publisher.XNAS_BASIC_FINC:
return "Nasdaq Basic - FINRA/Nasdaq TRF Chicago"
raise ValueError("Unexpected Publisher value")

0 comments on commit 5243ae8

Please sign in to comment.