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 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dryjq-1.3.1.tar.gz
(27.7 kB
view details)
Built Distribution
dryjq-1.3.1-py3-none-any.whl
(22.8 kB
view details)
File details
Details for the file dryjq-1.3.1.tar.gz
.
File metadata
- Download URL: dryjq-1.3.1.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34cc95b42bcc81ef81151e44b28eb7f317b87cfbdf28b6ad6bc6ac63d46c4302 |
|
MD5 | 7e5184b2a802c0c4b321eb12c18830c7 |
|
BLAKE2b-256 | 51d020af226e05161a515b9e1078cd4782babc4fb41c992e5c0e162374f531e7 |
File details
Details for the file dryjq-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: dryjq-1.3.1-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9717c921556bbf87089f36963b5d95c07009eaa22f84454217918e100e9d246a |
|
MD5 | abfbaa5fafd493f1e5ca77fe48294e5e |
|
BLAKE2b-256 | 3fb21b44ef1c1c7c0733d567f68bee17d5fbd08d1c8f699731a726bfec8145fa |