Skip to main content

A library to read config files written in Python.

Project description

Overview

A library for reading config files written in Python. Since Python config files are not sandboxed, you should only read config files that you trust.

By controlling the globals, locals, and builtins that are passed in to tthe config file, you can ‘pre-populate’ the config file with values, and you can control (to a very limited extent) what Python features are available to the config file.

Two interfaces are provided:

  • A low-level interface for that takes strings.

  • A high-level interfaces that supports nested configuration files.

In addition, there is a simple function to convert dicts to namedtuples.

Typical usage

Low-level interface

High-level interface

to_namedtuple

Change log

0.4 2016-11-02 Eric V. Smith

  • No code changes.

  • Always require setuptools (issue #2).

  • Remove code to modify the RPM name for bdist_rpm (issue #1).

0.3 2016-08-22 Eric V. Smith

  • Fixed fl_validator. Switched to a single namespace, instead of using globals and locals (This is because at module level, they’re the same). Switch to a dict-based interface, instead of always using namedtuples. Added to_namedtuple.

0.2 2016-08-21 Eric V. Smith

  • Added fl_validator.

0.1 2016-08-20 Eric V. Smith

  • Initial release.

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

pyconfreader-0.4.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

pyconfreader-0.4-py2-none-any.whl (5.3 kB view details)

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for pyconfreader-0.4.tar.gz
Algorithm Hash digest
SHA256 a83543a8c2c7174d72199ef4620358487a5587772ad564de483fb47f5e123e2a
MD5 3b2fe5f728d3ce8513e056e557dd2d8c
BLAKE2b-256 fc39d448f6699042ae228738510521f7385a9368e4bd17c3660f107775affc16

See more details on using hashes here.

File details

Details for the file pyconfreader-0.4-py2-none-any.whl.

File metadata

File hashes

Hashes for pyconfreader-0.4-py2-none-any.whl
Algorithm Hash digest
SHA256 4299e6083a101391473476155338362660226710fd45eccacbcb12266ebeda88
MD5 6b7944807314a61cd7e688070cd0ef95
BLAKE2b-256 9770b0298d07dd9fadaec24bd25be1d3fe4d185a7ba490fb2e1b56e3f7e00d50

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