Skip to main content

Helper scripts for writing configuration files based on environment variables

Project description

ContainedENV

Description

This project is meant to provide utilities for writing out configuration files based on environment variables. Lots of projects seem to be implementing this on their own (Elasticsearch/Grafana), but it would be nice to have one thing that works for them all...so...here we go!

Usage

Set your environment variables with a shared prefix. Section headers should be followed by a double underscore __

Example:

$ export MYPREFIX_foo__bar=baz
$ containedenv-config-writer.py -p MYPREFIX_
[foo]
bar = baz

Check out the help text for current usage info too:

usage: containedenv-config-writer.py [-h] -p PREFIX [-f {ini,json}]
                                     [-o OUTPUT_FILE] [-r REFERENCE_FILE]

Convert environment variables in to a configuration file

optional arguments:
  -h, --help            show this help message and exit
  -p PREFIX, --prefix PREFIX
                        Prefix of env vars to parse
  -f {ini,json}, --format {ini,json}
                        Output file format
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        Outfile file path
  -r REFERENCE_FILE, --reference-file REFERENCE_FILE
                        Load this reference file for existing/hard coded
                        values

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

containedenv-0.0.3.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file containedenv-0.0.3.tar.gz.

File metadata

  • Download URL: containedenv-0.0.3.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.6.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.5

File hashes

Hashes for containedenv-0.0.3.tar.gz
Algorithm Hash digest
SHA256 548388626a058754bc453951a7fa7f85ee68a966c6f49d9e333f8d3234503d3c
MD5 38a9596a8800aa5187ee09c8cbd1a328
BLAKE2b-256 892242e255ec53377df056ec3a65a2aabdbf85f28f4b127cbb553fc8b33e45f7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page