No project description provided
Project description
print-yaml
print-yaml is a CLI tool that prints yaml files according to the desired depth.
Installation
# using pip
$ pip install print_yaml
# using poetry
$ poetry add print_yaml
Usage
Let's say you have the following yaml file.
# data.yaml
a:
b: 1
c:
- one
- two
- three:
A: 6
B: 7
- four:
- 8
- 9
d:
e: 3
f: 4
g: 5
Basic
The following values can be obtained using print_yaml
$ print_yaml tests/data.yaml -d 1
a:
g:
$ print_yaml tests/data.yaml -d 2
a:
b:
c:
d:
g: 5
$ print_yaml tests/data.yaml -d 3
a:
b: 1
c:
- one
- two
- three:
- four:
d:
e:
f:
g: 5
With value
By default, only the "key" in the yaml file is output.
If you add the '--value' or '-v' option, it also outputs a single value.
$ print_yaml tests/data.yaml -d 1 -v
a:
g: 5
$ print_yaml tests/data.yaml -d 2 -v
a:
b: 1
c:
d:
g: 5
$ print_yaml tests/data.yaml -d 3 -v
a:
b: 1
c:
- one
- two
- three:
- four:
d:
e: 3
f: 4
g: 5
All Commands
$ print_yaml --help
Usage: print_yaml [OPTIONS] FILE_PATH
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ * file_path TEXT [default: None] [required] │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────╮
│ -d INTEGER RANGE [x>=0] [default: 0] │
│ --value -v │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or │
│ customize the installation. │
│ --help Show this message and exit. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file print-yaml-0.1.0.tar.gz.
File metadata
- Download URL: print-yaml-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.2 Linux/5.15.0-1020-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c2d3dfab6a278281da5150dbb34374dab884b9fefbddc33912998d763c126e6
|
|
| MD5 |
47c374e956b8ee1074c8997fb40dbbfd
|
|
| BLAKE2b-256 |
69aa15bd9bb70accf65ef28b169e7858cac489f3ad9dffefb1c284b7e0001a75
|
File details
Details for the file print_yaml-0.1.0-py3-none-any.whl.
File metadata
- Download URL: print_yaml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.2 Linux/5.15.0-1020-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4a0fecf2d58fb117a6b051af2036a9b8d735db67f06d5cdb60736d08976ec63
|
|
| MD5 |
d03f3a455d9e3755e929cb6aa1feccd1
|
|
| BLAKE2b-256 |
38e5bda83f957a5967e94a5af34e621c084a1f101fb64d1103c1bfa2654a6246
|