99 maybe_datetime_to_string ,
1010 maybe_enum_or_str_lowercase ,
1111 maybe_symbols_list_to_string ,
12+ values_list_to_string ,
1213)
1314from databento .common .validation import validate_enum , validate_maybe_enum
1415from databento .historical .api import API_VERSION
@@ -33,7 +34,7 @@ def list_datasets(
3334 """
3435 List all available datasets from Databento.
3536
36- Makes a `GET /v0/ metadata.list_datasets` HTTP request.
37+ Makes a `GET /metadata.list_datasets` HTTP request.
3738
3839 Parameters
3940 ----------
@@ -82,7 +83,7 @@ def list_schemas(
8283 """
8384 List all available data schemas from Databento.
8485
85- Makes a `GET /v0/ metadata.list_schemas` HTTP request.
86+ Makes a `GET /metadata.list_schemas` HTTP request.
8687
8788 Parameters
8889 ----------
@@ -124,7 +125,7 @@ def list_fields(
124125 """
125126 List all fields for a dataset, schema and encoding from Databento.
126127
127- Makes a `GET /v0/ metadata.list_fields` HTTP request.
128+ Makes a `GET /metadata.list_fields` HTTP request.
128129
129130 The `schema` and `encoding` parameters act as optional filters. All
130131 metadata for that parameter is returned if they are not specified.
@@ -168,7 +169,7 @@ def list_encodings(self) -> List[str]:
168169 """
169170 List all available data encodings from Databento.
170171
171- Makes a `GET /v0/ metadata.list_encodings` HTTP request.
172+ Makes a `GET /metadata.list_encodings` HTTP request.
172173
173174 Returns
174175 -------
@@ -185,7 +186,7 @@ def list_compressions(self) -> List[str]:
185186 """
186187 List all available data compression modes from Databento.
187188
188- Makes a `GET /v0/ metadata.list_compressions` HTTP request.
189+ Makes a `GET /metadata.list_compressions` HTTP request.
189190
190191 Returns
191192 -------
@@ -207,7 +208,7 @@ def list_unit_prices(
207208 """
208209 List data schema prices per GB unit from Databento.
209210
210- Makes a `GET /v0/ metadata.list_unit_prices` HTTP request.
211+ Makes a `GET /metadata.list_unit_prices` HTTP request.
211212
212213 Parameters
213214 ----------
@@ -258,7 +259,7 @@ def get_shape(
258259 """
259260 Get the shape of the time series data query.
260261
261- Makes a GET `/v0/ metadata.get_shape` HTTP request.
262+ Makes a GET `/metadata.get_shape` HTTP request.
262263
263264 Parameters
264265 ----------
@@ -337,7 +338,7 @@ def get_billable_size(
337338 Get the raw uncompressed binary size of a historical streaming or batch
338339 data request, which would be used for billing.
339340
340- Makes a GET `/v0/ metadata.get_billable_size` HTTP request.
341+ Makes a GET `/metadata.get_billable_size` HTTP request.
341342
342343 Parameters
343344 ----------
@@ -405,7 +406,7 @@ def get_cost(
405406 """
406407 Get cost in US Dollars for a historical streaming or batch data request.
407408
408- Makes a `GET /v0/ metadata.get_cost` HTTP request.
409+ Makes a `GET /metadata.get_cost` HTTP request.
409410
410411 Parameters
411412 ----------
@@ -464,3 +465,42 @@ def get_cost(
464465 )
465466
466467 return response .json ()
468+
469+ def get_license_fee (
470+ self ,
471+ dataset : Union [Dataset , str ],
472+ purposes : Union [List [str ], str ],
473+ ) -> int :
474+ """
475+ Get the license fee in US Dollars for a dataset and access purposes.
476+
477+ Makes a `GET /metadata.get_license_fee` HTTP request.
478+
479+ Parameters
480+ ----------
481+ dataset : Dataset or str
482+ The dataset name for the request.
483+ purposes : List[str] or str, {'professional trading', 'display usage', 'non-display usage', 'external redistribution', 'internal redistribution'} # noqa
484+ The licensing purposes.
485+
486+ Returns
487+ -------
488+ int
489+ The license fee in US Dollars.
490+
491+ """
492+ dataset = enum_or_str_lowercase (dataset , "dataset" )
493+ purposes = values_list_to_string (purposes )
494+
495+ params : List [Tuple [str , str ]] = [
496+ ("dataset" , dataset ),
497+ ("purposes" , purposes ),
498+ ]
499+
500+ response : Response = self ._get (
501+ url = self ._base_url + ".get_license_fee" ,
502+ params = params ,
503+ basic_auth = True ,
504+ )
505+
506+ return response .json ()
0 commit comments