Skip to main content

Configuration file loader

Project description

Configuration file loader for Python projects

Based on:


Read environment variables and config files and return them merged with predefined list of arguments.

  • appname: application name, used for config files and environemnt variable names.
  • args: arguments from command line (optparse, docopt, etc).
  • strip_dashes: strip dashes prefixing key names from args dict.
dict containing the merged variables of environment variables, config files and args.

Environment variables are read if they start with appname in uppercase with underscore, for example:


Config files compatible with ConfigParser are read and the section name appname is read, example:

Files are read from:
  • /etc/appname/config
  • /etc/appfilerc
  • ~/.config/appname/config
  • ~/.config/appname
  • ~/.appname/config
  • ~/.appnamerc
  • .appnamerc
  • file provided by config variable in args

Example usage with docopt:

args = rcfile(__name__, docopt(__doc__, version=__version__))
  • TODO


  • Python >= 2.6 or >= 3.3


MIT licensed. See the bundled LICENSE file for more details.

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 rcfile, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size rcfile-0.1.4.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View
Filename, size rcfile-0.1.4-py27-none-any.whl (6.1 kB) File type Wheel Python version 2.7 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page