utils
Helper functions used throughout the package.
- truncate(input, length)[source]
Truncate an input value to custom typed representation.
- Parameters:
input (T) – Value to be truncated. Can be of any type.
length (int) – Length to truncate the value to.
- Returns:
Truncated representation of the input.
- Return type:
T | str
- build_arg_string(args, truncate_length=10)[source]
Create string representation of an args tuple.
- Parameters:
args (tuple) – Tuple of arguments to be converted to a string.
truncate_length (int) – Length to truncate the string to.
- Returns:
String representation of the args.
- Return type:
str
- build_kwarg_string(kwargs, truncate_length=10)[source]
Create string representation of a kwargs dict.
- Parameters:
kwargs (dict) – Dictionary of keyword arguments to be converted to a string.
truncate_length (int) – Length to truncate the string to.
- Returns:
String representation of the kwargs dict.
- Return type:
str
- load_secrets(env='.env')[source]
Load secrets from a .env file.
The contents of the .env file are stored in a Secrets object.
- Parameters:
env (str) – Path to the .env file.
- Return type: