Awesome-Python-Scripts/json-to-yaml/Readme.md

20 lines
649 B
Markdown
Raw Normal View History

## 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.