Format Fusion is a CLI tool for converting various data formats: JSON, YAML, and images to Base64.
pip install cli-format-fusionFormat Fusion supports the following conversions:
| Conversion | Command | Options |
|---|---|---|
| JSON → YAML | format-fusion yaml |
--reverse, --output |
| YAML → JSON | format-fusion yaml --reverse |
--output |
| Image → Base64 | format-fusion image |
--output |
All commands support the --output option to specify the output file path.
# Convert JSON to YAML
format-fusion yaml D:\response_api.jsonResult: an output.yaml file will be created in the current directory.
# Convert YAML back to JSON
format-fusion yaml D:\response_api.yaml --reverseResult: an output.json file will be created.
# Save the converted file to a specific location
format-fusion yaml D:\response_api.json --output D:\data.yaml
Result: the file will be saved to the specified path D:\data.yaml.
# Convert an image to Base64 and save to a file
format-fusion image D:\screenshot.png --output D:\screenshot.txt
Result: a file screenshot.txt will be created containing the Base64-encoded content.