Skip to main content
Use Consulconf to get or set key:value data from json files or consul.

This tool supports the concept of inheritance, where one namespace of
key:value pairs can inherit one or more keys from another namespace.
This is particularly useful if, for instance, you wish to manage
environment variables for several applications that may share certain
variables in common. Currently, though, parent namespaces (ie any
namespace with children) cannot inherit from other namespaces. It may
be worth changing this behavior if someone can come up with a good
reason.

You don't necessarily need consul to use this tool.

Install:

```
pip install consulconf
```


Usage:

```
basic usage
consulconf -h
```

```
mkdir json_files

# basic examples
echo '{"MYVAR": "123", "OTHERVAR": 456}' > ./json_files/namespace.json
consulconf -i ./json_files --dry_run
consulconf -i ./json_files --app namespace env
consulconf -i ./json_files --app namespace echo \$MYVAR

# namespace filtering
echo '{"app1": {"AVAR": 1}, "app2": {"AVAR": 2}}' > ./json_files/apps.json
consulconf -i ./json_files --dry_run
consulconf -i ./json_files --dry_run --filterns '^apps/.*[12]$'


# inheritance
echo '{"_inherit": ["namespace.MYVAR"], "nines": 999}' > ./json_files/ns2.json
consulconf -i ./json_files --dry_run --filterns 'ns2'
consulconf -i ./json_files --app ns2 env

# push namespaces to consul (you need to have a consul agent installed)
consulconf -i ./json_files -p 127.0.0.1:8500/v1/kv/my_namespaces

# get namespaces from consul
consulconf -i http://127.0.0.1:8500/v1/kv/my_namespaces --dry_run
consulconf -i http://127.0.0.1:8500/v1/kv/my_namespaces --app ns2 env
```

Additionally, you can use this tool to raw copy the contents of json
files into consul. If you run the below commands and then navigate to
consul, you will see the data in your json files copied to consul.

```
consulconf -i ./json_files --dry_run --raw
consulconf -i ./json_files -p http://127.0.0.1:8500/v1/kv/rawdata --raw
consulconf -i http://127.0.0.1:8500/v1/kv/my_namespaces --dry_run --raw
```

NOTE: Some of the examples above assume a consul agent is running on
your computer. To get consul working, you could run something like:

http://www.consul.io/intro/getting-started/agent.html

Metadata

Release files for consulconf 0.0.11

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

Source distribution (sdist)

Source distribution for consulconf 0.0.11
File Size Uploaded Provenance
consulconf-0.0.11.zip 11.3 kB Without provenance Details

Release files / consulconf-0.0.11.zip

Download URL consulconf-0.0.11.zip
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0b0a73abe69c4cf819bab3222f34f6f6354037856d1e77254144f3d65c4d4d6f
BLAKE2b-256 checksum
How to use checksums
ec08a5ee3677f2f79eef45fbd68c91fad0434d4978600031eeaed2bceead39ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for consulconf 0.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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