Skip to main content

output envdir as JSON or YAML

Project description

cfgdir

Read envdir style configuration directory and output as JSON or YAML

https://github.com/rstms/cfgdir

Inspired by djb's excellent envdir, a component of daemontools

Leverage the powerful simplicity of the filesystem as your configuration database, and the freedom to fluidly manipulate configuration data from your shell.

Unlike envdir's mechanism of running another program with the configuration in environment variables, this program outputs a stream in JSON or YAML format. This output can be captured in a file or piped into stdin of another program.

Interface

cfgdir [OPTIONS] d [INPUT] [OUTPUT]

optionally reads a JSON or YAML object from INPUT (use - to read stdin) , then reads the directory named d, outputting a JSON or YAML object modified according to files in d.

The format of d is as follows: (adapted from envdir's documentation)

If d contains a file named s whose first line is t, cfgdir's output will contain an element named s with string value t. The name s must not contain =. Spaces and tabs at the end of t are removed. Nulls in t are changed to newlines.
If the file s is completely empty (0 bytes long) cfgdir will remove the element named s if it exists.

Arguments:

Argument default Description
DIRECTORY optional /dev/null Directory containing configuration data files
INPUT optional /dev/null Input filename or - for stdin
OUPUT optional stdout Output Filename or - for stdout

Options:

  -c, --compact  minimize output
  -s, --sort     sort output
  -j, --json     JSON format
  -y, --yaml     YAML format
  -r, --recurse  process subdirectories
  -o, --overlay  overlay JSON/YAML formatted string onto output
  --help         Show this message and exit.

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

cfgdir-0.3.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

cfgdir-0.3.2-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cfgdir-0.3.2.tar.gz.

File metadata

  • Download URL: cfgdir-0.3.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.7

File hashes

Hashes for cfgdir-0.3.2.tar.gz
Algorithm Hash digest
SHA256 308a9fa0a4ff99c69f90d5bfbb8dda0bd944e32906b59de4a0adf9214affea83
MD5 d31a0c2d1ee6a2361e24a16a53ea20d1
BLAKE2b-256 bb855f423c7d908c65b0f48208ab8af789b8da3d4d3265f2e574f2e86903529c

See more details on using hashes here.

Provenance

File details

Details for the file cfgdir-0.3.2-py2.py3-none-any.whl.

File metadata

  • Download URL: cfgdir-0.3.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.7

File hashes

Hashes for cfgdir-0.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dae2d6dc24a9028e9c08c6a8f90eae4c535cc2e39d82cbf43416907d2e721871
MD5 56574174a10d1ff3ab21a6dfc8367a3e
BLAKE2b-256 13a4ec7f2e6b136115a24d81aab40db035abe46d412da156b19c04f7a539a7c3

See more details on using hashes here.

Provenance

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