Skip to main content

A tool to generate models, code and schemas from markdown files

Project description

Markdown Models

Build Status

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 support
  • python-pydantic: PyDantic implementation with JSON-LD support
  • python-pydantic-xml: PyDantic implementation with XML support
  • xml-schema: XML schema definition
  • json-schema: JSON schema definition
  • shacl: SHACL shapes definition
  • shex: 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdmodels_core-0.1.2.tar.gz (114.0 kB view details)

Uploaded Source

Built Distribution

mdmodels_core-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Hashes for mdmodels_core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 70fa0772882801331694fa7beb628dd2dbcdfb1982834ba1004d5d99d8f1043f
MD5 83cbf2d4a6feaf8aa19fb0c699da5500
BLAKE2b-256 c518df02b4e1ec436ac0e3c6c33d8354fcf693d26aeefeee4379dcf803bbfbe7

See more details on using hashes here.

File details

Details for the file mdmodels_core-0.1.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mdmodels_core-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c887c3c7be4953be4dccb5d669c3fd6ad1e7a4b371a7a3fff32a5e8036f66e44
MD5 5858b00ceb3fe9f9c86d7c9e44178f7f
BLAKE2b-256 2e8093f27a9b484e576e26dfd0d93dd595f212fbbe4e31ce03246adf6d0948de

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page