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.

Source Distribution

pyconf-0.5.tar.gz (1.7 kB view details)

Uploaded Source

File details

Details for the file pyconf-0.5.tar.gz.

File metadata

  • Download URL: pyconf-0.5.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyconf-0.5.tar.gz
Algorithm Hash digest
SHA256 0b040520a6b330058bd11f97d51e221f9ba2897e5516eacb3014cc324aace865
MD5 7901a62ef704f050a0a2c42dec6c83c5
BLAKE2b-256 82396054458b9156dfdd3be3041cbc8b5e19499e43dec55e6199fd7657021af1

See more details on using hashes here.

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