Skip to content

Commit

Permalink
ADD: Add new NLS publishers for XBOS/XPSX
Browse files Browse the repository at this point in the history
  • Loading branch information
renan-databento committed Jun 18, 2024
1 parent 2814e04 commit 8213d4e
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### Enhancements
- Added type alias `TBBOMsg` for `MBP1Msg`
- Instances of the `Live` client will now call `Live.stop` when garbage collected
- Added new publisher values for `XNAS.BASIC` and `XNAS.NLS`

## 0.36.0 - 2024-06-11

Expand Down
52 changes: 52 additions & 0 deletions databento/common/publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,14 @@ class Publisher(StringyMixin, str, Enum):
ICE Futures Europe - Off-Market Trades.
NDEX_IMPACT_XOFF
ICE Endex - Off-Market Trades.
XNAS_NLS_XBOS
Nasdaq NLS - Nasdaq BX.
XNAS_NLS_XPSX
Nasdaq NLS - Nasdaq PSX.
XNAS_BASIC_XBOS
Nasdaq Basic - Nasdaq BX.
XNAS_BASIC_XPSX
Nasdaq Basic - Nasdaq PSX.
"""

Expand Down Expand Up @@ -1002,6 +1010,10 @@ class Publisher(StringyMixin, str, Enum):
XNAS_BASIC_FINC = "XNAS.BASIC.FINC"
IFEU_IMPACT_XOFF = "IFEU.IMPACT.XOFF"
NDEX_IMPACT_XOFF = "NDEX.IMPACT.XOFF"
XNAS_NLS_XBOS = "XNAS.NLS.XBOS"
XNAS_NLS_XPSX = "XNAS.NLS.XPSX"
XNAS_BASIC_XBOS = "XNAS.BASIC.XBOS"
XNAS_BASIC_XPSX = "XNAS.BASIC.XPSX"

@classmethod
def from_int(cls, value: int) -> Publisher:
Expand Down Expand Up @@ -1178,6 +1190,14 @@ def from_int(cls, value: int) -> Publisher:
return Publisher.IFEU_IMPACT_XOFF
if value == 85:
return Publisher.NDEX_IMPACT_XOFF
if value == 86:
return Publisher.XNAS_NLS_XBOS
if value == 87:
return Publisher.XNAS_NLS_XPSX
if value == 88:
return Publisher.XNAS_BASIC_XBOS
if value == 89:
return Publisher.XNAS_BASIC_XPSX
raise ValueError(f"Integer value {value} does not correspond with any Publisher variant")

def to_int(self) -> int:
Expand Down Expand Up @@ -1354,6 +1374,14 @@ def to_int(self) -> int:
return 84
if self == Publisher.NDEX_IMPACT_XOFF:
return 85
if self == Publisher.XNAS_NLS_XBOS:
return 86
if self == Publisher.XNAS_NLS_XPSX:
return 87
if self == Publisher.XNAS_BASIC_XBOS:
return 88
if self == Publisher.XNAS_BASIC_XPSX:
return 89
raise ValueError("Invalid Publisher")

@property
Expand Down Expand Up @@ -1531,6 +1559,14 @@ def venue(self) -> Venue:
return Venue.XOFF
if self == Publisher.NDEX_IMPACT_XOFF:
return Venue.XOFF
if self == Publisher.XNAS_NLS_XBOS:
return Venue.XBOS
if self == Publisher.XNAS_NLS_XPSX:
return Venue.XPSX
if self == Publisher.XNAS_BASIC_XBOS:
return Venue.XBOS
if self == Publisher.XNAS_BASIC_XPSX:
return Venue.XPSX
raise ValueError("Unexpected Publisher value")

@property
Expand Down Expand Up @@ -1708,6 +1744,14 @@ def dataset(self) -> Dataset:
return Dataset.IFEU_IMPACT
if self == Publisher.NDEX_IMPACT_XOFF:
return Dataset.NDEX_IMPACT
if self == Publisher.XNAS_NLS_XBOS:
return Dataset.XNAS_NLS
if self == Publisher.XNAS_NLS_XPSX:
return Dataset.XNAS_NLS
if self == Publisher.XNAS_BASIC_XBOS:
return Dataset.XNAS_BASIC
if self == Publisher.XNAS_BASIC_XPSX:
return Dataset.XNAS_BASIC
raise ValueError("Unexpected Publisher value")

@property
Expand Down Expand Up @@ -1885,4 +1929,12 @@ def description(self) -> str:
return "ICE Futures Europe - Off-Market Trades"
if self == Publisher.NDEX_IMPACT_XOFF:
return "ICE Endex - Off-Market Trades"
if self == Publisher.XNAS_NLS_XBOS:
return "Nasdaq NLS - Nasdaq BX"
if self == Publisher.XNAS_NLS_XPSX:
return "Nasdaq NLS - Nasdaq PSX"
if self == Publisher.XNAS_BASIC_XBOS:
return "Nasdaq Basic - Nasdaq BX"
if self == Publisher.XNAS_BASIC_XPSX:
return "Nasdaq Basic - Nasdaq PSX"
raise ValueError("Unexpected Publisher value")

0 comments on commit 8213d4e

Please sign in to comment.