Skip to main content

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.

Metadata

Release files for cfgdir 1.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 cfgdir 1.0.11
File Size Uploaded
cfgdir-1.0.11.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cfgdir 1.0.11
File Interpreter ABI Platform
cfgdir-1.0.11-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 11.4 kB

Release files / cfgdir-1.0.11.tar.gz

Download URL cfgdir-1.0.11.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
994f7a33f4c9e04b7f8476ad5fe25faf87eadccdcc3a44fb3da9cbbf465ae93b
BLAKE2b-256 checksum
How to use checksums
a4f2a64335e1ad069d069be0f94e2707ef01b5e027b4ac378be063c3c9162abc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / cfgdir-1.0.11-py2.py3-none-any.whl

Download URL cfgdir-1.0.11-py2.py3-none-any.whl
Size 6.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
943bb4e0a93688af741fa407463183e82cd631db98e67b9a6c2380ce8460909a
BLAKE2b-256 checksum
How to use checksums
e68e99920760abacfb4f7cf39dd903179b40ab30248a07582c2d15ea0d593c64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0.11 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.2

2 release files

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