The panko.utils Module

Utilities and helper functions.

panko.utils.decimal_to_dt(dec)

Return a datetime from Decimal unixtime format.

panko.utils.decode_unicode(input)

Decode the unicode of the message, and encode it into utf-8.

panko.utils.dt_to_decimal(utc)

Datetime to Decimal.

Some databases don’t store microseconds in datetime so we always store as Decimal unixtime.

panko.utils.recursive_keypairs(d, separator=':')

Generator that produces sequence of keypairs for nested dictionaries.

panko.utils.sanitize_timestamp(timestamp)

Return a naive utc datetime object.

panko.utils.update_nested(original_dict, updates)

Updates the leaf nodes in a nest dict.

Updates occur without replacing entire sub-dicts.