params
Functions to parse parameter values.
list_to_str(mapping)
¶
Convert any lists in a dictionary to a string with comma-separated elements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mapping |
ParamsMapping
|
Dictionary with lists |
required |
Returns:
Type | Description |
---|---|
ParamsMappingValues
|
Dictionary with lists converted to comma-separated strings |
Source code in bavapi/parsing/params.py
parse_date(value)
¶
Parse date string or datetime value into a date string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
(str, datetime, date)
|
Input to parse into a date string. |
required |
Returns:
Type | Description |
---|---|
str
|
The parsed date as a string. |
Source code in bavapi/parsing/params.py
to_fount_params(data, param)
¶
Constructs dictionary keys for special Fount API formatting.
The resulting dictionary keys will be formatted to include param
as the
main parameter name:
to_fount_params({"a":1}, "test")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
dict[str, Any]
|
Dictionary to format. |
required |
param |
str
|
Parameter name. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Fount API parameter dictionary. |