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

Load a value from an environmental variable, YAML/JSON file, or default to a provided value.

Getting chainload

Simply:

pip install chainload

Install requirements

pip install -r requirements.txt

or:

python setup.py install

Using chainload

If you have variables that exist in a file, I recommend assigning a file object to a variable, then passing that variable to the chain loading method.

e.g.

$ python
>>> from chainload import chainload
>>> variable_file = chainload.load_file(file_name="tests/test_settings.yaml")
>>> chainload.chain_load_variable("environment", "environment", "debug", variable_file)
'production'

or, if you have a lot of variables to load, use the class-based approach:

$ python
>>> chainer = chainload.ChainloadSetup(filename="tests/test_settings.yaml", environment_variable_prefix="webapp_")
>>> environment_value = chainer("environment")

the latter has the advantage of being far more DRY for larger use-cases.

See the docstring for chain_load_variable, but this will load a variable in order of:

  1. A default value

  2. From file object

  3. From an environment variable.

    Optional: If the environmental variable is None, and the specified file option name exists in the env, and this behavior is enabled, an attempt to load from an environmental variable of the same name as specified for #2

Running tests

If you want to run the tests for this package:

$ make test
python setup.py test
running nosetests
running egg_info
writing chainload.egg-info/PKG-INFO
writing top-level names to chainload.egg-info/top_level.txt
writing dependency_links to chainload.egg-info/dependency_links.txt
reading manifest file 'chainload.egg-info/SOURCES.txt'
writing manifest file 'chainload.egg-info/SOURCES.txt'
.........
----------------------------------------------------------------------
Ran 9 tests in 0.007s

Filing bugs / issues

When filing a bug report, please include a Short, Self Contained, Correct (Compilable), Example.

New features / Pull requests

If requesting a new feature, please include a well-explained use-case with example usage.

When making a pull request, if new functionality is added, please include appropriate tests.

Release History

Release History

1.4

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

1.3

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

1.2

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

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

1.0

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
chainload-1.4.tar.gz (5.4 kB) Copy SHA256 Checksum SHA256 Source May 20, 2016

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