Convert from YAML to Jsonnet format, retaining comments
Project description
Converts YAML into Jsonnet (specifically targetting YAML for Kubernetes)
Suppose that you have some YAML that you use for Kubernetes (either hand-written or output by Helm. Now you’d like to use Jsonnet instead, for its fancier templating capabilities. This is a pain, because while YAML->JSON converters are easy to find, they produce ugly-looking (but valid!) Jsonnet.
The goal of this project is to make the conversion a little easier: transform the YAML into slightly prettier Jsonnet, preserving comments along the way.
Development Setup
Install Poetry
Install Pre-commit
Run poetry install to install dependencies
Run poetry run python -m yaml2jsonnet /path/to/yaml to convert a file
Probably, run jsonnetfmt on the output, since the only whitespace I provide is newlines
Project details
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
Hashes for yaml2jsonnet-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f29e2a78ae728ebb11e07b10070cc2a0f9dea8ee95a920fc0d85c299b9101801 |
|
MD5 | 7ace3a4959aa00cf8151b6369f39b1fd |
|
BLAKE2b-256 | 5201bff3cae560cc92e9f7d90d0e723e5bd27bc3c9d88d757f3568cf8710e279 |