YAML Bundler
yamlbundler is a useful command that bundles multiple YAML files into a single file.
It finds !include tag in a YAML file and replaces it with the contents of another YAML file.
Install
pip install yamlbundler
Quick start
Save these files in your working directory.
# ./main.yaml
# include entire file
a: !include ./sub1.yaml # relative path from the parent directory of main.yaml
b: !include
filepath: ./sub2.yaml
# include specific value using jsonpath
c: !include
filepath: ./sub1.yaml
jsonpath: $.foo
# include multiple files
# Array elements are flattened.
d: !include
- filepath: ./sub1.yaml
- filepath: ./sub2.yaml
# include multiple files
# If all of them are map elements, they are merged into a single map.
e: !include
- filepath: ./sub1.yaml
- filepath: ./sub3.yaml
# ./sub1.yaml
foo: bar
# ./sub2.yaml
- one
- two
# ./sub3.yaml
hoge: !include
# relative path from the parent directory of sub3.yaml (not main.yaml)
filepath: ./sub2.yaml
jsonpath: $[0]
Then, run this command. The result is shown in your terminal as STDOUT. Comments in original YAML are removed.
yamlbundler ./main.yaml
# a:
# foo: bar
# b:
# - one
# - two
# c: bar
# d:
# - foo: bar
# - one
# - two
# e:
# foo: bar
# hoge: one
You can save the result as a new file using --output parameter.
If you want to overwrite the original file, use --inplace parameter.
yamlbundler --output ./result.yaml ./main.yaml
yamlbundler --inplace ./main.yaml
Feedback
If you find any bugs, please feel free to create an issue.
Metadata
Release files for yamlbundler 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yamlbundler-0.0.1.tar.gz | 3.8 kB | Without provenance | Details for yamlbundler-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| yamlbundler-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for yamlbundler-0.0.1-py3-none-any.whl |
Total release size: 8.6 kB
Release files / yamlbundler-0.0.1.tar.gz
| Download URL | yamlbundler-0.0.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61e6bedba8b1db4923cbea9cbfab8944588f1bc219d18d23c6bf23e4a318438a
|
|
BLAKE2b-256 checksum How to use checksums |
22c292e6abf06a6ae557e98b334e81f1a6d361d2043ce2f4833501bb84bf18a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure
|
Release files / yamlbundler-0.0.1-py3-none-any.whl
| Download URL | yamlbundler-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d03aeb9b0a2ff00935add6903db68d0a7dac49470b7c7ef52a60a48e6c1609b
|
|
BLAKE2b-256 checksum How to use checksums |
03d9adf672ee79aab0daa2c66636580e509386b20bf82085ea87c3735aa61ae5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-1024-azure
|
Security for yamlbundler 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.