A tool to generate models, code and schemas from markdown files
Project description
Markdown Models
This is a markdown parser and converter for Rust that can be used to parse markdown data model files and convert them to various formats, schemes and programming languages.
Installation
In order to install the command line tool, you can use the following command:
git clone https://github.com/JR-1991/md-models
cd md-models
cargo install --path .
Command line usage
The command line tool can be used to convert markdown files to various formats. The following command will convert a markdown file to Python code:
md-models convert -i model.md -o lib.py -l python-dataclass
This will read the input file model.md
and write the output to lib.py
using the Python dataclass template. Alternatively, you can also pass a URL as input to fetch the model remotely. For an overview of all available templates, you can use the following command:
md-models --help
Available templates
The following templates are available:
python-dataclass
: Python dataclass implementation with JSON-LD supportpython-pydantic
: PyDantic implementation with JSON-LD supportpython-pydantic-xml
: PyDantic implementation with XML supportxml-schema
: XML schema definitionjson-schema
: JSON schema definitionshacl
: SHACL shapes definitionshex
: ShEx shapes definition
Development
This project uses GitHub Actions for continuous integration. The tests can be run using the following command:
cargo test
cargo clippy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mdmodels_core-0.1.2.tar.gz
.
File metadata
- Download URL: mdmodels_core-0.1.2.tar.gz
- Upload date:
- Size: 114.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70fa0772882801331694fa7beb628dd2dbcdfb1982834ba1004d5d99d8f1043f |
|
MD5 | 83cbf2d4a6feaf8aa19fb0c699da5500 |
|
BLAKE2b-256 | c518df02b4e1ec436ac0e3c6c33d8354fcf693d26aeefeee4379dcf803bbfbe7 |
File details
Details for the file mdmodels_core-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: mdmodels_core-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c887c3c7be4953be4dccb5d669c3fd6ad1e7a4b371a7a3fff32a5e8036f66e44 |
|
MD5 | 5858b00ceb3fe9f9c86d7c9e44178f7f |
|
BLAKE2b-256 | 2e8093f27a9b484e576e26dfd0d93dd595f212fbbe4e31ce03246adf6d0948de |