1313from databento .common .http import BentoHttpAPI
1414from databento .common .parsing import convert_date_columns
1515from databento .common .parsing import convert_datetime_columns
16- from databento .common .parsing import datetime_to_date_string
17- from databento .common .parsing import optional_date_to_string
16+ from databento .common .parsing import datetime_to_string
17+ from databento .common .parsing import optional_datetime_to_string
1818from databento .common .parsing import optional_symbols_list_to_list
19- from databento .common .publishers import Dataset
20- from databento .common .validation import validate_semantic_string
2119
2220
2321class CorporateActionsHttpAPI (BentoHttpAPI ):
@@ -31,12 +29,12 @@ def __init__(self, key: str, gateway: str) -> None:
3129
3230 def get_range (
3331 self ,
34- start_date : date | str ,
35- end_date : date | str | None = None ,
36- dataset : Dataset | str | None = None ,
32+ start : pd .Timestamp | date | str | int ,
33+ end : pd .Timestamp | date | str | int | None = None ,
3734 symbols : Iterable [str ] | str | None = None ,
3835 stype_in : SType | str = "raw_symbol" ,
3936 events : Iterable [str ] | str | None = None ,
37+ us_only : bool = False ,
4038 ) -> pd .DataFrame :
4139 """
4240 Request a new corporate actions time series from Databento.
@@ -45,12 +43,16 @@ def get_range(
4543
4644 Parameters
4745 ----------
48- start_date : date or str
49- The start date (UTC) of the request time range (inclusive).
50- end_date : date or str, optional
51- The end date (UTC) of the request time range (exclusive).
52- dataset : Dataset or str, optional
53- The dataset code (string identifier) for the request.
46+ start : pd.Timestamp or date or str or int
47+ The start datetime of the request time range (inclusive).
48+ Assumes UTC as timezone unless passed a tz-aware object.
49+ If an integer is passed, then this represents nanoseconds since the UNIX epoch.
50+ end : pd.Timestamp or date or str or int, optional
51+ The end datetime of the request time range (exclusive).
52+ Assumes UTC as timezone unless passed a tz-aware object.
53+ If an integer is passed, then this represents nanoseconds since the UNIX epoch.
54+ Values are forward filled based on the resolution provided.
55+ Defaults to the same value as `start`.
5456 symbols : Iterable[str] or str, optional
5557 The symbols to filter for. Takes up to 2,000 symbols per request.
5658 If more than 1 symbol is specified, the data is merged and sorted by time.
@@ -64,26 +66,27 @@ def get_range(
6466 Takes any number of event types per request.
6567 If not specified then will be for **all** event types.
6668 See [EVENT](https://databento.com/docs/standards-and-conventions/reference-data-enums#event) enum.
69+ us_only : bool, default False
70+ If filtering for US markets only.
6771
6872 Returns
6973 -------
7074 pandas.DataFrame
7175 The data converted into a data frame.
7276
7377 """
74- dataset = validate_semantic_string (dataset , "dataset" ) if dataset is not None else None
7578 symbols_list = optional_symbols_list_to_list (symbols , SType .RAW_SYMBOL )
7679
7780 if isinstance (events , str ):
7881 events = events .strip ().strip ("," ).split ("," )
7982
8083 data : dict [str , object | None ] = {
81- "start_date" : datetime_to_date_string (start_date ),
82- "end_date" : optional_date_to_string (end_date ),
83- "dataset" : dataset ,
84+ "start" : datetime_to_string (start ),
85+ "end" : optional_datetime_to_string (end ),
8486 "symbols" : "," .join (symbols_list ),
8587 "stype_in" : stype_in ,
8688 "events" : "," .join (events ) if events else None ,
89+ "us_only" : us_only ,
8790 }
8891
8992 response = self ._post (
0 commit comments