core/influxdb: add main method to create influx measurement and fill with values

allows running something like

    python3 -m my.core.influxdb populate my.zotero
This commit is contained in:
Dima Gerasimov 2021-04-26 09:41:39 +01:00 committed by karlicoss
parent 0278f2b68d
commit 0517f7ffb8
4 changed files with 52 additions and 10 deletions

View file

@ -596,7 +596,7 @@ datetime_aware = datetime
def assert_subpackage(name: str) -> None:
# can lead to some unexpected issues if you 'import cachew' which being in my/core directory.. so let's protect against it
# NOTE: if we use overlay, name can be smth like my.origg.my.core.cachew ...
assert 'my.core' in name, f'Expected module __name__ ({name}) to start with my.core'
assert name == '__main__' or 'my.core' in name, f'Expected module __name__ ({name}) to be __main__ or start with my.core'
# https://stackoverflow.com/a/10436851/706389