simple_report.utils module¶
- class simple_report.utils.ColorMap(config)[source]¶
Bases:
objectColor map object for handling the color space of the report
- Parameters:
config (dict[str, Any])
- get_default_color(field, color_mode)[source]¶
Determine the correct default color for a given color mode and field
- Parameters:
field (str) – The type/field the color should be used for
color_mode (str) – The color mode of the report, i.e., either light or dark
- Returns:
str - The color to be used
- Return type:
str
- simple_report.utils.coerce_to_date(date)[source]¶
Coerce random data formats to a datetime.date object
- Parameters:
date (Union[str, int, datetime.date, datetime.datetime]) – The date to coerce
- Returns:
datetime.date - The coerce date object
- Return type:
date
- simple_report.utils.default(var, default)[source]¶
Helper function to check kwargs and set them to a default
You could simply use var or default. But for future additions we will use a separat function here :param var: The input variable :type var: Any :param default: Default value for the variable :type default: Any
- Returns
Any - Either the variable itself, or the default value if var is None
- Parameters:
var (Any)
default (Any)
- Return type:
Any