numerapi.utils module

collection of utility functions

numerapi.utils.download_file(url: str, dest_path: str, show_progress_bars: bool = True)[source]

downloads a file and shows a progress bar. allow resuming a download

numerapi.utils.is_valid_uuid(val: str) bool[source]

check if the given string is a valid UUID

numerapi.utils.parse_datetime_string(string: str) datetime | None[source]

try to parse string to datetime object

numerapi.utils.parse_float_string(string: str) float | None[source]

try to parse string to decimal.Decimal object

numerapi.utils.post_with_err_handling(url: str, body: str, headers: Dict, timeout: int | None = None, retries: int = 3, delay: int = 1, backoff: int = 2) Dict[source]

send post request and handle (some) errors that might occur

numerapi.utils.replace(dictionary: Dict, key: str, function)[source]

apply a function to dict item