mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
e5864acaf9
* Added automation for converting json to yaml format * Create Readme.md * Deletd the extra files * Added requirements.txt * Added name and project in project list Co-authored-by: Ayush Bhardwaj <classicayush@gmail.com> |
||
---|---|---|
.. | ||
example.json | ||
json2yaml.py | ||
output.yaml | ||
Readme.md | ||
requirements.txt |
JSON To YAML Converter
If you are working with config files or need to expose YAML via an API, you will probably find yourself needing to convert a file from JSON to YAML format. So I have tried to automate the same, by writing the following python script
For running this, you need to install/import the following libraries
- import json
- import yaml
Then in command prompt you just need to type:
python json2yaml.py input_file.json output_file.yaml
Here, input_file.json needs to be replaced with the name of your json file, and the output_file.yaml needs to be replaced with the name which you want for your yaml file.