DBNStore.request_symbology
Request to resolve symbology mappings based on the metadata properties.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
client | Historical | required | The historical client to use for the request (contains the API key). |
Returns
dict[str, Any]
A result including a map of input symbol to output symbol across a date range.
API method
1 2 3
DBNStore.request_symbology(
client: Historical,
) -> dict[str, Any] Example usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
import databento as db
client = db.Historical("$YOUR_API_KEY")
data = client.timeseries.get_range(
dataset="GLBX.MDP3",
symbols=["ESM2"],
schema="trades",
start="2022-06-06",
)
# Save streamed data to .dbn.zst
data.to_file("GLBX-ESM2-20201229.trades.dbn.zst")
# Read saved .dbn.zst
stored_data = db.DBNStore.from_file("GLBX-ESM2-20201229.trades.dbn.zst")
# Request symbology from .dbn.zst metadata
symbology = stored_data.request_symbology(client=client)
print(symbology) Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
{
"result": {
"ESM2": [
{
"d0": "2022-06-06",
"d1": "2022-06-07",
"s": "3403"
}
]
},
"symbols": [
"ESM2"
],
"stype_in": "raw_symbol",
"stype_out": "instrument_id",
"start_date": "2022-06-06",
"end_date": "2022-06-07",
"partial": [],
"not_found": [],
"message": "OK",
"status": 0
}