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

niceconf is a dropin replacement for the stdlib RawConfigParser object. It makes parsing and using configuration files in your python scripts approximately 10 times more pythonic and fun.

By default it reads and writes to ~/.conf. This can be changed by setting $CONF. If ~/.conf or the file specified in $CONF does not exist, it will be created on the first import.


basic usage:
>>> from niceconf import config
>>> config
gmail
my-database
secret-stuff
>>> config['gmail']
[gmail]
username = rick@gmail.com
password = wubalubadubdub
>>> config['gmail']['username']
'rick@gmail.com'
>>> config['gmail']['password']
'wubalubadubdub'
add or set config file options:
>>> config['my-database']['port'] = 3306
>>> config['my-database']['port']
'3306'
delete config file options:
>>> del config['secret-stuff']['burn-after-reading']
>>> config['secret-stuff']['burn-after-reading']
NoOptionError: No option 'burn-after-reading' in section: 'secret-stuff'
add a section (any valid dict-like can be added as section):
>>> config['stackoverflow'] = {'username': 'guido',
                               'password': 'pa$$word1'}
>>> config['stackoverflow']
[stackoverflow]
username = guido
password = pa$$word1
delete a section:
>>> del config['stackoverflow']
>>> config['stackoverflow']
NoSectionError: No section: 'stackoverflow'
write out to a file (overwrites by default):
>>> config.save()
read in another config file:
>>> config.read('/path/to/conf')
['/path/to/conf']
>>> config
gmail
my-database
secret-stuff
first_section_of_other_conf
second_section_of_other_conf
explode conf into function arguments
>>> print_kwargs(**config['gmail'])
{'username': 'rick@gmail.com', 'password': 'wubalubadubdub'}

Additionally, the config object _is_ an instance of RawConfigParser, so you can use any of those methods as before. This means that config is a dropin replacement for ConfigParser.

Release History

Release History

0.1.2

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

0.1.1

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
niceconf-0.1.2.tar.gz (3.3 kB) Copy SHA256 Checksum SHA256 Source Nov 4, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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