From 5243ae87f18d4f4edc5c4a4024408c40a49a5d68 Mon Sep 17 00:00:00 2001 From: Renan Gemignani Date: Mon, 27 May 2024 12:56:47 +0200 Subject: [PATCH] ADD: Add XNAS.BASIC publishers --- databento/common/publishers.py | 64 +++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/databento/common/publishers.py b/databento/common/publishers.py index 3914758..0239aeb 100644 --- a/databento/common/publishers.py +++ b/databento/common/publishers.py @@ -485,6 +485,8 @@ class Dataset(StringyMixin, str, Enum): ICE Endex iMpact. DBEQ_MAX Databento Equities Max. + XNAS_BASIC + Nasdaq Basic (NLS+QBBO). """ @@ -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: @@ -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: @@ -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 @@ -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") @@ -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 @@ -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 @@ -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. """ @@ -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: @@ -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: @@ -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 @@ -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 @@ -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 @@ -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: @@ -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: @@ -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")