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.4.tar.gz (1.6 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pyconf-0.4.tar.gz
Algorithm Hash digest
SHA256 9ba3c2bfcf05829c35a10ebd05b94cad24eee8f0e14721f17096541c049d1279
MD5 e1236af2fc0a16a62f5f7c87ae4ed899
BLAKE2b-256 84008539b17588c4242c3da6678e0a185760a7e812d9c8af4a3a64822955138e

See more details on using hashes here.

Provenance

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