dp3.common.utils ¶
auxiliary/utility functions and classes
entity_expired ¶
Check if entity is expired (all TTLs are in the past)
int2bytes ¶
Convert signed int to however many bytes necessary in big-endian order
bytes2int ¶
parse_rfc_time ¶
Parse time in RFC 3339 format and return it as naive datetime in UTC.
Timezone specification is optional (UTC is assumed when none is specified).
Source code in dp3/common/utils.py
parse_time_duration ¶
Parse duration in format (or just "0").
Return datetime.timedelta
Source code in dp3/common/utils.py
conv_to_json ¶
Convert special types to JSON (use as "default" param of json.dumps)
Supported types/objects: - datetime - timedelta
Source code in dp3/common/utils.py
conv_from_json ¶
Convert special JSON keys created by conv_to_json back to Python objects (use as "object_hook" param of json.loads)
Supported types/objects: - datetime - timedelta
Source code in dp3/common/utils.py
batched ¶
Batch data into tuples of length n. The last batch may be shorter.
Source code in dp3/common/utils.py
get_func_name ¶
Get name of function or method as pretty string.