Skip to content

Commit ff967c1

Browse files
committed
MOD: Standardize API and docs
1 parent 8f0a03c commit ff967c1

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

databento/historical/api/batch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def timeseries_submit(
5757
dataset : Dataset or str
5858
The dataset name for the request.
5959
symbols : List[Union[str, int]] or str, optional
60-
The symbols for the request. If ``None`` then will be for **all** symbols.
60+
The product symbols to filter for. Takes up to 10,000 symbols per request.
61+
If more than 1 symbol is specified, the data is merged and sorted by time.
62+
If `*` or ``None`` then will be for **all** symbols.
6163
schema : Schema or str {'mbo', 'mbp-1', 'mbp-10', 'trades', 'tbbo', 'ohlcv-1s', 'ohlcv-1m', 'ohlcv-1h', 'ohlcv-1d', 'definition', 'statistics', 'status'}, default 'trades' # noqa
6264
The data record schema for the request.
6365
start : pd.Timestamp or date or str or int, optional

databento/historical/api/metadata.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ def get_shape(
266266
dataset : Dataset or str
267267
The dataset name for the request.
268268
symbols : List[Union[str, int]] or str, optional
269-
The symbols for the request. If ``None`` then will be for **all** symbols.
269+
The product symbols to filter for. Takes up to 10,000 symbols per request.
270+
If `*` or ``None`` then will be for **all** symbols.
270271
schema : Schema or str {'mbo', 'mbp-1', 'mbp-10', 'trades', 'tbbo', 'ohlcv-1s', 'ohlcv-1m', 'ohlcv-1h', 'ohlcv-1d', 'definition', 'statistics', 'status'}, default 'trades' # noqa
271272
The data record schema for the request.
272273
start : pd.Timestamp or date or str or int, optional
@@ -342,7 +343,8 @@ def get_billable_size(
342343
dataset : Dataset or str
343344
The dataset name for the request.
344345
symbols : List[Union[str, int]] or str, optional
345-
The symbols for the request. If ``None`` then will be for **all** symbols.
346+
The product symbols to filter for. Takes up to 10,000 symbols per request.
347+
If `*` or ``None`` then will be for **all** symbols.
346348
schema : Schema or str {'mbo', 'mbp-1', 'mbp-10', 'trades', 'tbbo', 'ohlcv-1s', 'ohlcv-1m', 'ohlcv-1h', 'ohlcv-1d', 'definition', 'statistics', 'status'}, default 'trades' # noqa
347349
The data record schema for the request.
348350
start : pd.Timestamp or date or str or int, optional
@@ -410,7 +412,8 @@ def get_cost(
410412
mode : FeedMode or str {'live', 'historical-streaming', 'historical'}, default 'historical-streaming'
411413
The data feed mode for the request.
412414
symbols : List[Union[str, int]] or str, optional
413-
The symbols for the request. If ``None`` then will be for **all** symbols.
415+
The product symbols to filter for. Takes up to 10,000 symbols per request.
416+
If `*` or ``None`` then will be for **all** symbols.
414417
schema : Schema or str {'mbo', 'mbp-1', 'mbp-10', 'trades', 'tbbo', 'ohlcv-1s', 'ohlcv-1m', 'ohlcv-1h', 'ohlcv-1d', 'definition', 'statistics', 'status'}, default 'trades' # noqa
415418
The data record schema for the request.
416419
start : pd.Timestamp or date or str or int, optional

databento/historical/api/symbology.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def resolve(
3838
dataset : Dataset or str
3939
The dataset name for the request.
4040
symbols : List[Union[str, int]] or str, optional
41-
The symbols to resolve.
41+
The symbols to resolve. Takes up to 10,000 symbols per request.
42+
If `*` or ``None`` then will be for **all** symbols.
4243
stype_in : SType or str, default 'native'
4344
The input symbology type to resolve from.
4445
stype_out : SType or str, default 'product_id'

databento/historical/api/timeseries.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def stream(
4141
dataset : Dataset or str
4242
The dataset name for the request.
4343
symbols : List[Union[str, int]] or str, optional
44-
The symbols for the request. If ``None`` then will be for **all** symbols.
44+
The product symbols to filter for. Takes up to 10,000 symbols per request.
45+
If more than 1 symbol is specified, the data is merged and sorted by time.
46+
If `*` or ``None`` then will be for **all** symbols.
4547
schema : Schema or str {'mbo', 'mbp-1', 'mbp-10', 'trades', 'tbbo', 'ohlcv-1s', 'ohlcv-1m', 'ohlcv-1h', 'ohlcv-1d', 'definition', 'statistics', 'status'}, default 'trades' # noqa
4648
The data record schema for the request.
4749
start : pd.Timestamp or date or str or int, optional
@@ -124,7 +126,7 @@ async def stream_async(
124126
stype_in: Union[SType, str] = "native",
125127
stype_out: Union[SType, str] = "product_id",
126128
limit: Optional[int] = None,
127-
path: str = None,
129+
path: Optional[str] = None,
128130
) -> Bento:
129131
"""
130132
Request a historical time series stream from Databento asynchronously.
@@ -136,7 +138,9 @@ async def stream_async(
136138
dataset : Dataset or str
137139
The dataset name for the request.
138140
symbols : List[Union[str, int]] or str, optional
139-
The symbols for the request. If ``None`` then will be for **all** symbols.
141+
The product symbols to filter for. Takes up to 10,000 symbols per request.
142+
If more than 1 symbol is specified, the data is merged and sorted by time.
143+
If `*` or ``None`` then will be for **all** symbols.
140144
schema : Schema or str {'mbo', 'mbp-1', 'mbp-10', 'trades', 'tbbo', 'ohlcv-1s', 'ohlcv-1m', 'ohlcv-1h', 'ohlcv-1d', 'definition', 'statistics', 'status'}, default 'trades' # noqa
141145
The data record schema for the request.
142146
start : pd.Timestamp or date or str or int, optional

tests/test_historical_bento.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_sources_metadata_returns_expected_json_as_dict(self) -> None:
6464
"partial": [],
6565
"not_found": [],
6666
"mappings": {
67-
"ESH1": [{"t0": "2020-12-28", "t1": "2020-12-29", "s": "5482"}]
67+
"ESH1": [{"d0": "2020-12-28", "d1": "2020-12-29", "s": "5482"}]
6868
},
6969
"definitions": {},
7070
}
@@ -112,14 +112,14 @@ def test_bento_given_initial_nbytes_returns_expected_metadata(self) -> None:
112112
assert data.compression == Compression.ZSTD
113113
assert data.shape == (2, 14)
114114
assert data.mappings == {
115-
"ESH1": [{"s": "5482", "t0": "2020-12-28", "t1": "2020-12-29"}]
115+
"ESH1": [{"s": "5482", "d0": "2020-12-28", "d1": "2020-12-29"}]
116116
}
117117
assert data.symbology == {
118118
"start_date": "2020-12-28",
119119
"message": "OK",
120120
"not_found": [],
121121
"partial": [],
122-
"result": {"ESH1": [{"s": "5482", "t0": "2020-12-28", "t1": "2020-12-29"}]},
122+
"result": {"ESH1": [{"s": "5482", "d0": "2020-12-28", "d1": "2020-12-29"}]},
123123
"status": 0,
124124
"stype_in": "native",
125125
"stype_out": "product_id",

0 commit comments

Comments
 (0)