YAML to Markdown Converter
A Python utility to take a JSON / YAML file or a python dict / list and create a Markdown file.
Installation
pip install yaml-to-markdown
Usage
$ yaml-to-markdown --help
Convert JSON or YAML to Markdown.
Usage: yaml-to-markdown -o <output_file> [-y <yaml_file> | -j <json_file>]
-o, --output-file <output_file>: Path to the output file as a string [Mandatory].
-y, --yaml-file <yaml_file>: Path to the YAML file as a string [Optional]
-j, --json-file <json_file>: Path to the JSON file as a string [Optional]
-h, --help: Show this message and exit.
Note: Either yaml_file or json_file is required along with output_file.
Example: yaml-to-markdown -o output.md -y data.yaml
In Python Code example:
Convert a Pyton dictionary to Markdown:
from yaml_to_markdown.md_converter import MDConverter
data = {
"name": "John Doe",
"age": 30,
"city": "Sydney",
"hobbies": ["reading", "swimming"],
}
converter = MDConverter()
with open("output.md", "w") as f:
converter.convert(data, f)
Content of output.md file will be:
## Name
John Doe
## Age
30
## City
Sydney
## Hobbies
* reading
* swimming
From the Command Line
You can also use the command line interface to convert a JSON or YAML file to Markdown. Here's an example:
Convert a JSON file to Markdown:
yaml-to-markdown --output-file output.md --json-file test.json
Convert a YAML file to Markdown:
yaml-to-markdown --output-file output.md --yaml-file test.yaml
Developer Guide
Please see the DEVELOPER.md file for more information on how to contribute to this project.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for yaml-to-markdown 0.1.1733456289
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yaml_to_markdown-0.1.1733456289.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yaml_to_markdown-0.1.1733456289-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / yaml_to_markdown-0.1.1733456289.tar.gz
| Download URL | yaml_to_markdown-0.1.1733456289.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
946e78db15de50ed323352b373de10fda9f26b04a5652cca02921a9ec135d7ec
|
|
BLAKE2b-256 checksum How to use checksums |
0ab019525b73818e70069332ae25783ffcc051f7ea077d5a06d08033e8fdff62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / yaml_to_markdown-0.1.1733456289-py3-none-any.whl
| Download URL | yaml_to_markdown-0.1.1733456289-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bc3c950280164794027dc5f27e4203fad16ec1b88cff1d8d6f2431cd1e34a7f
|
|
BLAKE2b-256 checksum How to use checksums |
f8cfcf983cc7df9164ba248e2ceb10b569fa2ab846b811c35317493e1e6028c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|