Skip to main content

Helps bring configuration, stored remotely on a ``Consul`` server, to your application

Project description

rconfig helps bring configuration, stored remotely on a Consul server, to your application.


Install the latest version with:

pip3 install -U python-rconfig

For command-line support, use the CLI option during installation:

pip3 install -U "python-rconfig[cli]"


First off all rconfig expects that you have the following key structure on the consul server:

    |          |
    |          |___<some-env-key>
    |          |           |_____<key-value>
    |          |           |_____<key-value>
    |          |
    |          |___<another-env-key>
    |                      |_____<key-value>
    |                      |_____<key-value>
               |           |_____<key-value>
               |           |_____<key-value>

Here root key stands for the name of the project when some have multiple applications that grouped under some kind of common purpose (often when talk about microservices). Under common configuration key, you should store configurations that common to all your applications in the project, in this case, it’s much easier to change the config in one place than go to multiple.

Command-line Interface

CLI offers you an ability to load config from Consul (within a few ways) without a need of changing application code.

Usage: rconfig [OPTIONS] COMMAND [ARGS]...

  -h, --host TEXT     Host of a consul server  [required]
  -a, --access TEXT   Access key for a consul server  [required]
  -p, --port INTEGER  Port of consul server  [default: 8500]
  -k, --key TEXT      Consul key  [required]
  --help              Show this message and exit.

  export  Print out bash command export for all found config
  list    Show all config for given keys

Let’s see some examples.


To load prod config of you-awesome-app, issue:

$ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' list


To export config to different formats, use:

$ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f bash

$ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f json


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-rconfig-20.2.0.tar.gz (5.7 kB view hashes)

Uploaded source

Built Distribution

python_rconfig-20.2.0-py3-none-any.whl (6.1 kB view hashes)

Uploaded py3

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