Skip to main content

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 is strongly 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] [--separator SEPARATOR]
             [--subscript-indicators SUBSCRIPT_INDICATORS]
             [query] [input_file]

Drastically Reduced YAML / JSON Query

positional arguments:
  query                 the query (simplest form of yq/jq syntax, default is
                        the separator character alone).
  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)

Query syntax options:
  control the query syntax

  --separator SEPARATOR
                        the separator character (default: '.')
  --subscript-indicators SUBSCRIPT_INDICATORS
                        the subscript indicator character(s) (default: '[]')

Issues, feature requests

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

Metadata

Release files for dryjq 1.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dryjq 1.9.1
File Size Uploaded
dryjq-1.9.1.tar.gz 23.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dryjq 1.9.1
File Interpreter ABI Platform
dryjq-1.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.0 kB

Release files / dryjq-1.9.1.tar.gz

Download URL dryjq-1.9.1.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eff3d8be00d740e2befa57a97724f358cd7c5d95c0972326ad6d7d363fc51cca
BLAKE2b-256 checksum
How to use checksums
4854466a45c85956fc7df2e17bfcf63666afad089f0990af2389b23d2a76cda4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / dryjq-1.9.1-py3-none-any.whl

Download URL dryjq-1.9.1-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3d87ecf1d08dc57d83ec9431b79393425a7e71f7a23d7c295cab23c698b01b0
BLAKE2b-256 checksum
How to use checksums
c5817b397c47b9369da9e1baa0337fe4536e6e1a90d883fabfa5ad357cac3790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

1.9.1 This release

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

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