Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.49.0 - 2025-03-04

#### Enhancements
- Added new venues, datasets, and publishers for ICE Futures US and for ICE Futures
Europe (Financial products)
- Added a `keep_zip` parameter to `Historical.batch.download()`. When `True`, and downloading all files, the jobs contents will be saved as a ZIP file
- Calling `Live.terminate()` will now attempt to write EOF before aborting the connection to help close the remote end

## 0.48.0 - 2025-01-21

#### Breaking changes
Expand Down
4 changes: 4 additions & 0 deletions databento/common/dbnstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,10 @@ def to_df(
"""
Return the data as a `pd.DataFrame`.

Notes
-----
The DataFrame index will be set to `ts_recv` if it exists in the schema, otherwise it will be set to `ts_event`.

Parameters
----------
price_type : PriceType or str, default "float"
Expand Down
6 changes: 3 additions & 3 deletions databento/common/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,14 @@ def convert_datetime_columns(df: pd.DataFrame, columns: list[str]) -> None:
df[column] = df[column].apply(convert_to_datetime)


def convert_ndjson_to_df(data: bytes, compressed: bool) -> pd.DataFrame:
def convert_jsonl_to_df(data: bytes, compressed: bool) -> pd.DataFrame:
"""
Convert the given NDJSON bytes `data` to a pandas DataFrame.
Convert the given JSON lines bytes `data` to a pandas DataFrame.

Parameters
----------
data : bytes
The NDJSON data as bytes to be converted.
The JSON lines data as bytes to be converted.
compressed : bool
If the content is zstd compressed.

Expand Down
88 changes: 88 additions & 0 deletions databento/common/publishers.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ class Venue(StringyMixin, str, Enum):
IntelligentCross ASPEN Inverted.
EQUS
Databento US Equities - Consolidated.
IFUS
ICE Futures US.
IFLL
ICE Futures Europe (Financials).

"""

Expand Down Expand Up @@ -160,6 +164,8 @@ class Venue(StringyMixin, str, Enum):
ASMT = "ASMT"
ASPI = "ASPI"
EQUS = "EQUS"
IFUS = "IFUS"
IFLL = "IFLL"

@classmethod
def from_int(cls, value: int) -> Venue:
Expand Down Expand Up @@ -260,6 +266,10 @@ def from_int(cls, value: int) -> Venue:
return Venue.ASPI
if value == 47:
return Venue.EQUS
if value == 48:
return Venue.IFUS
if value == 49:
return Venue.IFLL
raise ValueError(f"Integer value {value} does not correspond with any Venue variant")

def to_int(self) -> int:
Expand Down Expand Up @@ -360,6 +370,10 @@ def to_int(self) -> int:
return 46
if self == Venue.EQUS:
return 47
if self == Venue.IFUS:
return 48
if self == Venue.IFLL:
return 49
raise ValueError("Invalid Venue")

@property
Expand Down Expand Up @@ -461,6 +475,10 @@ def description(self) -> str:
return "IntelligentCross ASPEN Inverted"
if self == Venue.EQUS:
return "Databento US Equities - Consolidated"
if self == Venue.IFUS:
return "ICE Futures US"
if self == Venue.IFLL:
return "ICE Futures Europe (Financials)"
raise ValueError("Unexpected Venue value")


Expand Down Expand Up @@ -540,6 +558,10 @@ class Dataset(StringyMixin, str, Enum):
NYSE Trades and BBO.
EQUS_MINI
Databento US Equities Mini.
IFUS_IMPACT
ICE Futures US iMpact.
IFLL_IMPACT
ICE Futures Europe (Financials) iMpact.

"""

Expand Down Expand Up @@ -578,6 +600,8 @@ class Dataset(StringyMixin, str, Enum):
XCIS_TRADESBBO = "XCIS.TRADESBBO"
XNYS_TRADESBBO = "XNYS.TRADESBBO"
EQUS_MINI = "EQUS.MINI"
IFUS_IMPACT = "IFUS.IMPACT"
IFLL_IMPACT = "IFLL.IMPACT"

@classmethod
def from_int(cls, value: int) -> Dataset:
Expand Down Expand Up @@ -654,6 +678,10 @@ def from_int(cls, value: int) -> Dataset:
return Dataset.XNYS_TRADESBBO
if value == 35:
return Dataset.EQUS_MINI
if value == 36:
return Dataset.IFUS_IMPACT
if value == 37:
return Dataset.IFLL_IMPACT
raise ValueError(f"Integer value {value} does not correspond with any Dataset variant")

def to_int(self) -> int:
Expand Down Expand Up @@ -730,6 +758,10 @@ def to_int(self) -> int:
return 34
if self == Dataset.EQUS_MINI:
return 35
if self == Dataset.IFUS_IMPACT:
return 36
if self == Dataset.IFLL_IMPACT:
return 37
raise ValueError("Invalid Dataset")

@property
Expand Down Expand Up @@ -807,6 +839,10 @@ def description(self) -> str:
return "NYSE Trades and BBO"
if self == Dataset.EQUS_MINI:
return "Databento US Equities Mini"
if self == Dataset.IFUS_IMPACT:
return "ICE Futures US iMpact"
if self == Dataset.IFLL_IMPACT:
return "ICE Futures Europe (Financials) iMpact"
raise ValueError("Unexpected Dataset value")


Expand Down Expand Up @@ -1008,6 +1044,14 @@ class Publisher(StringyMixin, str, Enum):
Databento US Equities Mini.
XNYS_TRADES_EQUS
NYSE Trades - Consolidated.
IFUS_IMPACT_IFUS
ICE Futures US.
IFUS_IMPACT_XOFF
ICE Futures US - Off-Market Trades.
IFLL_IMPACT_IFLL
ICE Futures Europe (Financials).
IFLL_IMPACT_XOFF
ICE Futures Europe (Financials) - Off-Market Trades.

"""

Expand Down Expand Up @@ -1107,6 +1151,10 @@ class Publisher(StringyMixin, str, Enum):
EQUS_ALL_EQUS = "EQUS.ALL.EQUS"
EQUS_MINI_EQUS = "EQUS.MINI.EQUS"
XNYS_TRADES_EQUS = "XNYS.TRADES.EQUS"
IFUS_IMPACT_IFUS = "IFUS.IMPACT.IFUS"
IFUS_IMPACT_XOFF = "IFUS.IMPACT.XOFF"
IFLL_IMPACT_IFLL = "IFLL.IMPACT.IFLL"
IFLL_IMPACT_XOFF = "IFLL.IMPACT.XOFF"

@classmethod
def from_int(cls, value: int) -> Publisher:
Expand Down Expand Up @@ -1305,6 +1353,14 @@ def from_int(cls, value: int) -> Publisher:
return Publisher.EQUS_MINI_EQUS
if value == 96:
return Publisher.XNYS_TRADES_EQUS
if value == 97:
return Publisher.IFUS_IMPACT_IFUS
if value == 98:
return Publisher.IFUS_IMPACT_XOFF
if value == 99:
return Publisher.IFLL_IMPACT_IFLL
if value == 100:
return Publisher.IFLL_IMPACT_XOFF
raise ValueError(f"Integer value {value} does not correspond with any Publisher variant")

def to_int(self) -> int:
Expand Down Expand Up @@ -1503,6 +1559,14 @@ def to_int(self) -> int:
return 95
if self == Publisher.XNYS_TRADES_EQUS:
return 96
if self == Publisher.IFUS_IMPACT_IFUS:
return 97
if self == Publisher.IFUS_IMPACT_XOFF:
return 98
if self == Publisher.IFLL_IMPACT_IFLL:
return 99
if self == Publisher.IFLL_IMPACT_XOFF:
return 100
raise ValueError("Invalid Publisher")

@property
Expand Down Expand Up @@ -1702,6 +1766,14 @@ def venue(self) -> Venue:
return Venue.EQUS
if self == Publisher.XNYS_TRADES_EQUS:
return Venue.EQUS
if self == Publisher.IFUS_IMPACT_IFUS:
return Venue.IFUS
if self == Publisher.IFUS_IMPACT_XOFF:
return Venue.XOFF
if self == Publisher.IFLL_IMPACT_IFLL:
return Venue.IFLL
if self == Publisher.IFLL_IMPACT_XOFF:
return Venue.XOFF
raise ValueError("Unexpected Publisher value")

@property
Expand Down Expand Up @@ -1901,6 +1973,14 @@ def dataset(self) -> Dataset:
return Dataset.EQUS_MINI
if self == Publisher.XNYS_TRADES_EQUS:
return Dataset.XNYS_TRADES
if self == Publisher.IFUS_IMPACT_IFUS:
return Dataset.IFUS_IMPACT
if self == Publisher.IFUS_IMPACT_XOFF:
return Dataset.IFUS_IMPACT
if self == Publisher.IFLL_IMPACT_IFLL:
return Dataset.IFLL_IMPACT
if self == Publisher.IFLL_IMPACT_XOFF:
return Dataset.IFLL_IMPACT
raise ValueError("Unexpected Publisher value")

@property
Expand Down Expand Up @@ -2100,4 +2180,12 @@ def description(self) -> str:
return "Databento US Equities Mini"
if self == Publisher.XNYS_TRADES_EQUS:
return "NYSE Trades - Consolidated"
if self == Publisher.IFUS_IMPACT_IFUS:
return "ICE Futures US"
if self == Publisher.IFUS_IMPACT_XOFF:
return "ICE Futures US - Off-Market Trades"
if self == Publisher.IFLL_IMPACT_IFLL:
return "ICE Futures Europe (Financials)"
if self == Publisher.IFLL_IMPACT_XOFF:
return "ICE Futures Europe (Financials) - Off-Market Trades"
raise ValueError("Unexpected Publisher value")
Loading