Skip to main content

Python-based configuration reader

Project description

Python-based configuration reader

Simply enough, loads a file into a Python module object but does not place it in the module cache or otherwise bind it.

>>> import posixpath
>>> conf = load(posixpath.__file__)
>>> conf  # doctest: +ELLIPSIS
<module '<config>' from '...'>
>>> conf.pathsep
':'

And so on. You could also use load_dict to get a dict instead:

>>> type(load_dict(posixpath.__file__))
<type 'dict'>

Though, if you try to load files that aren’t recognized or loadable, you get an error:

>>> load("lala.ini")
Traceback (most recent call last):
  ...
ConfigurationError: no suitable loader for config module 'lala.ini'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyconf, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size pyconf-0.5.tar.gz (1.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page