Skip to main content
https://badge.fury.io/py/rcfile.png https://travis-ci.org/aequitas/rcfile.png?branch=master https://pypip.in/d/rcfile/badge.png https://coveralls.io/repos/aequitas/rcfile/badge.png?branch=master

Configuration file loader for Python projects

Based on: https://github.com/dominictarr/rc

Features

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

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.

Returns:

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:

TEST_VAR=1

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

[appname]
var=1
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

Requirements

  • Python >= 2.6 or >= 3.3

License

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

Release files for rcfile 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rcfile 0.1.4
File Size Uploaded
rcfile-0.1.4.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rcfile 0.1.4
File Interpreter ABI Platform
rcfile-0.1.4-py27-none-any.whl Python 2.7 none any Details

Total release size: 9.9 kB

Release files / rcfile-0.1.4.tar.gz

Download URL rcfile-0.1.4.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
21bdab7e1b82a6277c18effc90e1163e9e09edbcded260a3940d6a3afa5f8bf9
BLAKE2b-256 checksum
How to use checksums
bd6e18417ba4cb5260ab7f079247e681f79c06581a8cc3ec18377585deb0de8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rcfile-0.1.4-py27-none-any.whl

Download URL rcfile-0.1.4-py27-none-any.whl
Size 6.1 kB
Tags Python 2.7
SHA-256 checksum
How to use checksums
3fa3a9757a11f2e7b2f1ea7ea4e1144fe4f2e964865832b2891739579072cc14
BLAKE2b-256 checksum
How to use checksums
aecb208b8622eae72fb0e3a6db423177723a794c1577bb746a8c541f02824156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page