This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

By default, configparser only loads values from ‘vars’, ‘section’, and then ‘default_section’. This extension allows for nested sections by use of a section splitter (default ‘.’) and attempts to find values from ‘vars’, then ‘section’, then its logical parents, and finally ‘default_section’.

For example, given the configuration below:

[DEFAULT]
alpha=first level

[section]
beta=second level

[section.subsection]
gamma=third level

the default configparser would behave like:

>>> settings = configparser.ConfigParser()
>>> settings.read('config.ini')
['config.ini']
>>> settings.get('section.subsection', 'alpha')
first level
>>> settings.get('section.subsection', 'beta')
None
>>> settings.get('section.subsection', 'gamma')
third level

Instead, in this extension, the behaviour would be:

>>> settings = nestedconfigparser.NestedConfigParser()
>>> settings.read('config.ini')
['config.ini']
>>> settings.get('section.subsection', 'alpha')
first level
>>> settings.get('section.subsection', 'beta')
second level
>>> settings.get('section.subsection', 'gamma')
third level

This extensions supports theoretically unlimited levels of nesting. It also does not require each level of the subsection to exist for the case where a section has no additional configurations.

Note: this extension intentionally does not raise a NoSectionError if a section does not exist when using ‘nestedconfigparser.NestedConfigParser().get(section, option)’. This is because it will attempt to fallback to higher sections and avoids potentially empty sections that don’t have any added configurations at the highest subsection.

Release History

Release History

0.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
allya.nestedconfigparser-0.1.0-py3-none-any.whl (4.7 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Aug 17, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting