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 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
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
Built Distribution
File details
Details for the file dryjq-0.5.0.tar.gz
.
File metadata
- Download URL: dryjq-0.5.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 605cbbbec3652be986682b9ad23f16475cba444db5a904f679ee872f81758f70 |
|
MD5 | 977fdea72cd41245274b0bcde171a235 |
|
BLAKE2b-256 | e583682ab9e486f42f11ccd44da97e5ebfdde9cef3d3c9c9a4ae8c57fe880568 |
File details
Details for the file dryjq-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: dryjq-0.5.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebea69e65dc589a833d65950f15e6b9c59b148b9de15c81857fe7d5731383fdf |
|
MD5 | 575708cddce15cf16b3119c914e35a8d |
|
BLAKE2b-256 | 52b85652874eee94c7e88b8256702f060d7da40f8c2ba34bc5bc59b6048d6a05 |