Skip to main content

Drastically Reduced YAML / JSON Query

Project description

Drastically Reduced YAML / JSON Query

Lightweight package providing a subset of yq or jq functionality:

  • get a single value from a YAML or JSON file
  • change a single value in a YAML or JSON file

Requirements

PyYAML (Version 5.4.1 or newer)

Installation

pip install dryjq

Installation in a virtual environment or with the --user option is recommended.

Usage

Please see the documentation at https://blackstream-x.gitlab.io/python-dryjq for detailed usage information.

The documentation is generated from the MarkDown files in this repository’s docs/ directory.

Output of dryjq --help (or python3 -m dryjq --help):

usage: dryjq [-h] [--version] [-i] [-d | -v | -q] [-o OUTPUT_FORMAT]
             [--indent {2,4,8}] [--sort-keys]
             [query] [input_file]

Drastically Reduced YAML / JSON Query

positional arguments:
  query                 the query (simplest form of yq/jq syntax, default is
                        '.').
  input_file            the input file name (by default, data will be read
                        from standard input)

options:
  -h, --help            show this help message and exit
  --version             print version and exit
  -i, --inplace         modify the input file in place instead of writing the
                        result to standard output

Logging options:
  control log level (default is WARNING)

  -d, --debug           output all messages (log level DEBUG)
  -v, --verbose         be more verbose (log level INFO)
  -q, --quiet           be more quiet (log level ERROR)

Output options:
  control output formatting

  -o OUTPUT_FORMAT, --output-format OUTPUT_FORMAT
                        output format (choice of 'JSON': set output format to
                        JSON, 'YAML': set output fromat to YAML, 'input': keep
                        input format, 'toggle': change JSON to YAML or vice
                        versa; default: 'input')
  --indent {2,4,8}      indentation depth of blocks, in spaces (default: 2)
  --sort-keys           sort mapping keys (by default, mapping keys are left
                        in input order)

Issues, feature requests

Please open an issue here if you found a bug or have a feature suggestion.

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

dryjq-0.8.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

dryjq-0.8.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file dryjq-0.8.0.tar.gz.

File metadata

  • Download URL: dryjq-0.8.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for dryjq-0.8.0.tar.gz
Algorithm Hash digest
SHA256 5e33f9afacaaf15bc8496f22284e93714f7b5eb992cca15cec4167a2ec85d1a5
MD5 7ba0ebd65d61c0595f66cb788303df71
BLAKE2b-256 d6c5b8918497d6d0844bc5627422fb64533366549663754249f9ba8240139000

See more details on using hashes here.

File details

Details for the file dryjq-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: dryjq-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for dryjq-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5c416cd94204d8b314b9bf9849346a64c7ecf29187abb2691e4ba8e67bde52d
MD5 bc1125f6e9a288fd7917154cc32e20ef
BLAKE2b-256 5c72f38338c4d1d7d13957f6007c71ba95cc0979402eb5b74d32a94689b8c53f

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