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] [-v] [-q] [--version] [--modify-in-place] [-of {JSON,YAML}]
             [-oi {2,4,8}] [-osk]
             [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
  -v, --verbose         output all messages including debug level
  -q, --quiet           limit message output to warnings and errors
  --version             print version and exit
  --modify-in-place     Modify the input file in place instead of writing the
                        result to standard output.

Output options:
  control how output will be formatted

  -of {JSON,YAML}, --output-format {JSON,YAML}
                        File format. By default, the detected input format is
                        used.
  -oi {2,4,8}, --output-indent {2,4,8}
                        Indentation depth of blocks, in spaces (default: 2).
  -osk, --output-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.4.0b1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

dryjq-0.4.0b1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file dryjq-0.4.0b1.tar.gz.

File metadata

  • Download URL: dryjq-0.4.0b1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for dryjq-0.4.0b1.tar.gz
Algorithm Hash digest
SHA256 732e3753fc9fd5c77d1c7c993a54c2ff5e8f6f9605fc9420866f2129f2f4944d
MD5 e911cd19d400f2f1ffffa1f3e4d564b7
BLAKE2b-256 ec32886939e315d0ad2235678565df3cfc4c6eca94a60b207360d93acd9aa955

See more details on using hashes here.

File details

Details for the file dryjq-0.4.0b1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for dryjq-0.4.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 0bfb69591c6793521cfa2f6b15bc7f8338a90fda00b45f87291683eab17d0820
MD5 caab90db09f50035f66651950ace5b90
BLAKE2b-256 37b662cec86e591a0607babf991d27f5c4cbb8d0e5ae0b1a4b32aa8be7b49908

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