core

Compose analytics modules for Wodan & AICore using NBDev literate programming tool.

Logging


source

init_console_logging

 init_console_logging (name, level=20, timestamp=True, formatstring='')

Setup none-blocking stream handler for sending loggin to the console.

Various functions


source

dict_structure

 dict_structure (the_dict:dict, indent='    ')
Code
print(dict_structure({
    "key_1": "A string",
    "longerkey_2": [1,2,3],
    "key_3": dict(a=[], b="2", c=3)
}))
    key_1           :   <class 'str'>
    longerkey_2     :   <class 'list'>
    key_3           :   <class 'dict'>
        a               :   <class 'list'>
        b               :   <class 'str'>
        c               :   <class 'int'>

Date & time


source

unix_time

 unix_time (some_time)

Convert to unix (epoch) timestamp


source

make_naive_tzaware

 make_naive_tzaware (d, tz='UTC')

source

make_naive_utc

 make_naive_utc (d)

source

make_datetime

 make_datetime (d)