Awesome-Python-Scripts/json-to-yaml
stark117 e5864acaf9
Added automation for converting JSON to YAML format. (#197)
* 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>
2020-10-30 13:03:16 +05:30
..
example.json Added automation for converting JSON to YAML format. (#197) 2020-10-30 13:03:16 +05:30
json2yaml.py Added automation for converting JSON to YAML format. (#197) 2020-10-30 13:03:16 +05:30
output.yaml Added automation for converting JSON to YAML format. (#197) 2020-10-30 13:03:16 +05:30
Readme.md Added automation for converting JSON to YAML format. (#197) 2020-10-30 13:03:16 +05:30
requirements.txt Added automation for converting JSON to YAML format. (#197) 2020-10-30 13:03:16 +05:30

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.