Skip to main content

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 Distribution

cdxbasics-0.0.11.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

cdxbasics-0.0.11-py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page