55from databento .common .enums import Dataset , Encoding , FeedMode , Schema , SType
66from databento .common .parsing import (
77 enum_or_str_lowercase ,
8+ maybe_date_to_string ,
89 maybe_datetime_to_string ,
910 maybe_enum_or_str_lowercase ,
1011 maybe_symbols_list_to_string ,
@@ -26,8 +27,8 @@ def __init__(self, key, gateway):
2627
2728 def list_datasets (
2829 self ,
29- start : Optional [Union [pd . Timestamp , date , str , int ]] = None ,
30- end : Optional [Union [pd . Timestamp , date , str , int ]] = None ,
30+ start_date : Optional [Union [date , str ]] = None ,
31+ end_date : Optional [Union [date , str ]] = None ,
3132 ) -> List [str ]:
3233 """
3334 List all datasets available from Databento.
@@ -36,12 +37,10 @@ def list_datasets(
3637
3738 Parameters
3839 ----------
39- start : pd.Timestamp or date or str or int, optional
40- The UTC start datetime for the request range.
41- If using an integer then this represents nanoseconds since UNIX epoch.
42- end : pd.Timestamp or date or str or int, optional
43- The UTC end datetime for the request range.
44- If using an integer then this represents nanoseconds since UNIX epoch.
40+ start_date : date or str, optional
41+ The start date (UTC) for the request range.
42+ end_date : date or str, optional
43+ The end date (UTC) for the request range.
4544
4645 Returns
4746 -------
@@ -59,12 +58,12 @@ def list_datasets(
5958 other methods which take the `dataset` parameter.
6059
6160 """
62- start = maybe_datetime_to_string ( start )
63- end = maybe_datetime_to_string ( end )
61+ start_date = maybe_date_to_string ( start_date )
62+ end_date = maybe_date_to_string ( end_date )
6463
6564 params : List [Tuple [str , str ]] = [
66- ("start " , start ),
67- ("end " , end ),
65+ ("start_date " , start_date ),
66+ ("end_date " , end_date ),
6867 ]
6968
7069 response : Response = self ._get (
@@ -77,8 +76,8 @@ def list_datasets(
7776 def list_schemas (
7877 self ,
7978 dataset : Union [Dataset , str ],
80- start : Optional [Union [pd . Timestamp , date , str , int ]] = None ,
81- end : Optional [Union [pd . Timestamp , date , str , int ]] = None ,
79+ start_date : Optional [Union [date , str ]] = None ,
80+ end_date : Optional [Union [date , str ]] = None ,
8281 ) -> List [str ]:
8382 """
8483 List all data schemas available from Databento.
@@ -89,26 +88,24 @@ def list_schemas(
8988 ----------
9089 dataset : Dataset or str
9190 The dataset name for the request.
92- start : pd.Timestamp or date or str or int, optional
93- The start datetime for the request range (UTC).
94- If using an integer then this represents nanoseconds since UNIX epoch.
95- end : pd.Timestamp or date or str or int, optional
96- The end datetime for the request range (UTC).
97- If using an integer then this represents nanoseconds since UNIX epoch.
91+ start_date : date or str, optional
92+ The start date (UTC) for the request range.
93+ end_date : date or str, optional
94+ The end date (UTC) for the request range.
9895
9996 Returns
10097 -------
10198 List[str]
10299
103100 """
104101 dataset = enum_or_str_lowercase (dataset , "dataset" )
105- start = maybe_datetime_to_string ( start )
106- end = maybe_datetime_to_string ( end )
102+ start_date = maybe_date_to_string ( start_date )
103+ end_date = maybe_date_to_string ( end_date )
107104
108105 params : List [Tuple [str , str ]] = [
109106 ("dataset" , dataset ),
110- ("start " , start ),
111- ("end " , end ),
107+ ("start_date " , start_date ),
108+ ("end_date " , end_date ),
112109 ]
113110
114111 response : Response = self ._get (
@@ -272,10 +269,12 @@ def get_shape(
272269 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
273270 The data record schema for the request.
274271 start : pd.Timestamp or date or str or int, optional
275- The start datetime for the request range (UTC).
272+ The start datetime for the request range.
273+ Assumes UTC as timezone unless passed a tz-aware object.
276274 If using an integer then this represents nanoseconds since UNIX epoch.
277275 end : pd.Timestamp or date or str or int, optional
278- The end datetime for the request range (UTC).
276+ The end datetime for the request range.
277+ Assumes UTC as timezone unless passed a tz-aware object.
279278 If using an integer then this represents nanoseconds since UNIX epoch.
280279 encoding : Encoding or str {'dbz', 'csv', 'json'}, optional
281280 The data encoding.
@@ -347,10 +346,12 @@ def get_billable_size(
347346 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
348347 The data record schema for the request.
349348 start : pd.Timestamp or date or str or int, optional
350- The start datetime for the request range (UTC).
349+ The start datetime for the request range.
350+ Assumes UTC as timezone unless passed a tz-aware object.
351351 If using an integer then this represents nanoseconds since UNIX epoch.
352352 end : pd.Timestamp or date or str or int, optional
353- The end datetime for the request range (UTC).
353+ The end datetime for the request range.
354+ Assumes UTC as timezone unless passed a tz-aware object.
354355 If using an integer then this represents nanoseconds since UNIX epoch.
355356 stype_in : SType or str, default 'native'
356357 The input symbol type to resolve from.
@@ -414,10 +415,12 @@ def get_cost(
414415 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
415416 The data record schema for the request.
416417 start : pd.Timestamp or date or str or int, optional
417- The start datetime for the request range (UTC).
418+ The start datetime for the request range.
419+ Assumes UTC as timezone unless passed a tz-aware object.
418420 If using an integer then this represents nanoseconds since UNIX epoch.
419421 end : pd.Timestamp or date or str or int, optional
420- The end datetime for the request range (UTC).
422+ The end datetime for the request range.
423+ Assumes UTC as timezone unless passed a tz-aware object.
421424 If using an integer then this represents nanoseconds since UNIX epoch.
422425 stype_in : SType or str, default 'native'
423426 The input symbol type to resolve from.
0 commit comments