Skip to content

Commit

Permalink
ADD: Add and rename symbology types
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Jul 25, 2024
1 parent f62a74f commit 672d969
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 11 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog

## 0.19.2 - TBD
## 0.20.0 - TBD

### Enhancements
- Added new `SType` variants for reference data: `Isin`, `UsCode`, `BbgCompId`, `BbgCompTicker`, `Figi`, `FigiTicker`

### Breaking changes
- Renamed `SType::Nasdaq` variant to `SType::NasdaqSymbol`
- Renamed `SType::Cms` variant to `SType::CmsSymbol`

## 0.19.2 - 2024-07-23

### Bug fixes
- Fixed issue where `AsyncDynReader` would only decode the first frame of multi-frame
Expand Down
26 changes: 22 additions & 4 deletions python/python/databento_dbn/_lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,37 @@ class SType(Enum):
PARENT
A Databento-specific symbology for referring to a group of symbols by one
"parent" symbol, e.g. ES.FUT to refer to all ES futures.
NASDAQ
NASDAQ_SYMBOL
Symbology for US equities using NASDAQ Integrated suffix conventions.
CMS
CMS_SYMBOL
Symbology for US equities using CMS suffix conventions.
ISIN
Symbology using International Security Identification Numbers (ISIN) - ISO 6166.
US_CODE
Symbology using US domestic Committee on Uniform Securities Identification Procedure (CUSIP) codes.
BBG_COMP_ID
Symbology using Bloomberg composite global IDs.
BBG_COMP_TICKER
Symbology using Bloomberg composite tickers.
FIGI
Symbology using Bloomberg FIGI exchange level IDs.
FIGI_TICKER
Symbology using Bloomberg exchange level tickers.
"""

INSTRUMENT_ID: str
RAW_SYMBOL: str
CONTINUOUS: str
PARENT: str
NASDAQ: str
CMS: str
NASDAQ_SYMBOL: str
CMS_SYMBOL: str
ISIN: str
US_CODE: str
BBG_COMP_ID: str
BBG_COMP_TICKER: str
FIGI: str
FIGI_TICKER: str

@classmethod
def from_str(cls, value: str) -> SType: ...
Expand Down
36 changes: 30 additions & 6 deletions rust/dbn/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,21 @@ pub enum SType {
/// "parent" symbol, e.g. ES.FUT to refer to all ES futures.
Parent = 4,
/// Symbology for US equities using NASDAQ Integrated suffix conventions.
Nasdaq = 5,
NasdaqSymbol = 5,
/// Symbology for US equities using CMS suffix conventions.
Cms = 6,
CmsSymbol = 6,
/// Symbology using International Security Identification Numbers (ISIN) - ISO 6166.
Isin = 7,
/// Symbology using US domestic Committee on Uniform Securities Identification Procedure (CUSIP) codes.
UsCode = 8,
/// Symbology using Bloomberg composite global IDs.
BbgCompId = 9,
/// Symbology using Bloomberg composite tickers.
BbgCompTicker = 10,
/// Symbology using Bloomberg FIGI exchange level IDs.
Figi = 11,
/// Symbology using Bloomberg exchange level tickers.
FigiTicker = 12,
}

impl std::str::FromStr for SType {
Expand All @@ -247,8 +259,14 @@ impl std::str::FromStr for SType {
"smart" => Ok(SType::Smart),
"continuous" => Ok(SType::Continuous),
"parent" => Ok(SType::Parent),
"nasdaq" => Ok(SType::Nasdaq),
"cms" => Ok(SType::Cms),
"nasdaq_symbol" | "nasdaq" => Ok(SType::NasdaqSymbol),
"cms_symbol" | "cms" => Ok(SType::CmsSymbol),
"isin" => Ok(SType::Isin),
"us_code" => Ok(SType::UsCode),
"bbg_comp_id" => Ok(SType::BbgCompId),
"bbg_comp_ticker" => Ok(SType::BbgCompTicker),
"figi" => Ok(SType::Figi),
"figi_ticker" => Ok(SType::FigiTicker),
_ => Err(crate::Error::conversion::<Self>(s.to_owned())),
}
}
Expand All @@ -270,8 +288,14 @@ impl SType {
SType::Smart => "smart",
SType::Continuous => "continuous",
SType::Parent => "parent",
SType::Nasdaq => "nasdaq",
SType::Cms => "cms",
SType::NasdaqSymbol => "nasdaq_symbol",
SType::CmsSymbol => "cms_symbol",
SType::Isin => "isin",
SType::UsCode => "us_code",
SType::BbgCompId => "bbg_comp_id",
SType::BbgCompTicker => "bbg_comp_ticker",
SType::Figi => "figi",
SType::FigiTicker => "figi_ticker",
}
}
}
Expand Down

0 comments on commit 672d969

Please sign in to comment.