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

cnfg

Simple configuration should be simple. Here’s example.py:

import cnfg
settings = cnfg.load('.examplerc')
print(settings['message'])

Relative paths are awful. Not all systems have /etc. The only reasonable place to put configuration is in your home directory.

JSON and YAML are not Python. eval is not so bad. Here’s .examplerc:

# It's Python, so you can use comments (and more)
{"message": "My custom message."}

Now all of these work, with relative directories as implied:

./example.py
python ../example.py
cat example/example.py | python

What about default settings?

It’s up to you, but it’s easy, especially if you’re keeping all your configuration in a dict:

settings = {"message": "Default message!"}
settings.update(cnfg.load('.examplerc'))

What about environment variables?

It’s up to you, but it’s easy:

import os
some_var = os.getenv("SOME_VAR", "some default value")

What about “from config import settings,” like confire?

It’s up to you, but it’s easy. Just make a file called config.py and define settings in it.

Where’s my home directory?

On a Mac or Linux machine, echo ~. On Windows, echo %userprofile%.

This is so abstract!

Check out the example.

This is so trivial!

Yes, it’s as simple as possible, and it’s useful all over the place and the right level of complexity for a lot of projects.

Release History

Release History

1.0.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

0.0.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
cnfg-1.0.0.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Jul 3, 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