Skip to main content

output envdir as JSON or YAML

Project description

cfgdir

Read envdir style configuration directory and output as JSON or YAML

Project is hosted at 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 required 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
  --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.0.5.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

cfgdir-0.0.5-py2.py3-none-any.whl (4.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: cfgdir-0.0.5.tar.gz
  • Upload date:
  • Size: 3.2 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.0.5.tar.gz
Algorithm Hash digest
SHA256 30a75c7b691d99b5ca73b138708a62513bfb48189fe7652e9a3ef087aac6d795
MD5 d4b6e442dcc2ce7a41126ed590c983fc
BLAKE2b-256 8f7e11df728a174c4b5ba1e1ba4dede827f7f6af137bbc7e93a8e9fc409e1a76

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: cfgdir-0.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 77308bc57fb38c2bc5f42fccb83f58e38b65d6a36e9cb423e4fa394411b8768d
MD5 a5e531363775a643dcd9eec6b837ab38
BLAKE2b-256 3c3ab8a161125e632008c8ef1ddb9927d5d3046715cd5e54ecfdebebc2b7c6ed

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