Skip to main content

configparser module with lasers (for now with Jinja2 support)

Project description

Travis Codecov PyPI License Python versions PyPI downloads per month

configparserplus

If you have to multiple .ini files (for instance, when dealing with Pyramid's settings) you probably realized that the lack of a decent hierarchy between settings files just sucks.

configparserplus allows you to use Jinja2 templating language on your .ini files so you don't need to ctrl-C, ctrl-V your settings in your N config files. Seriously, never do it again. Just. Never.

Usage:

Just replace:

from configparser import ConfigParser  # `from ConfigParser import ConfigParser` in Python2
config = ConfigParser()

... to:

from configparserplus import ConfigParserPlus
config = ConfigParserPlus()

... and refactor your .ini files to use Jinja stuff (such as templates inheritance)

For more details, please check these examples. Ah! Configparserplus works normally on non-jinja (boring, regular) .ini files - so you can just replace it and refactor bit by bit.

Development:

Run linter:

pip install -r requirements_dev.txt
isort -rc .
tox -e lint

Run tests via tox:

pip install -r requirements_dev.txt
tox

Release a new major/minor/patch version:

pip install -r requirements_dev.txt
bump2version <PART>  # <PART> can be either 'patch' or 'minor' or 'major'

Upload to PyPI:

pip install -r requirements_dev.txt
python setup.py sdist bdist_wheel
python -m twine upload dist/*

Contributing:

Please open issues if you see one, or create a pull request when possible. In case of a pull request, please consider the following:

  • Respect the line length (132 characters)
  • Write automated tests
  • Run tox locally so you can see if everything is green (including linter and other python versions)

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 configparserplus, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size configparserplus-0.0.6-py2-none-any.whl (4.5 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size configparserplus-0.0.6.tar.gz (3.9 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