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.load_secrets() → tuple[source]
load secrets from environment variables or dotenv file
-
numerapi.utils.parse_datetime_string(string: str) → datetime | None[source]
try to parse string to datetime object
-
numerapi.utils.parse_float_string(string: str) → Decimal | None[source]
try to parse string to decimal.Decimal object
-
numerapi.utils.post_with_err_handling(url: str, body: dict, 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