Basic Python tools
Project description
cdxbasics
Collection of basic tools for Python development. Highlights are
- Generic(): object which operates both like a dictionary and like an object, e.g. one can write
from cdxbasics import Generic
g = Generic(a=1, b=2) # construction with nice keywords
g.c = 3
a = g.a
a = g['a']
d = g.get('d',None) # with default
e = g('e',None) # with default
del c
del .... - Logger: classic C++ style defensive programming VERIFY tools, e.g.
from cdxbasics import Logger
_log = Logger(__file__)
_log.verify( a==1, "'a' is not one but %s", a)
_log.warn_if( a!=1, "'a' was not one but %s", a)
and other features. - dctkwargs: tool to capture misspelled **kwargs.
Use
from cdxbasics import dctkwargs
def f(**kwargs):
kwargs = dctkwargs(kwargs)
a = kwargs('a') # standard
b = kwargs('b', None) # with default
assert kwargs.isDone(), "Unknown keywords: %s" % str(kwargs) - fmt(): integrated short cut
- uniqueHash(): runs a standard hash over most combinations of standard elements or objects
- plain(): converts most combinations of standards elements or objects into plain list/dict structures
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
cdxbasics-0.0.10-py3-none-any.whl
(11.1 kB
view hashes)
Close
Hashes for cdxbasics-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1098d5fab351cf293d2657f14b97f314b8a415caeeb17dba7f8cc919a767a960 |
|
MD5 | a41b4165ced219501e8ddeb7e81a63ba |
|
BLAKE2b-256 | 6fdd271d7c3aa97b5fb1994113010d2c0af34120013a2908f587c27c5e886549 |