Skip to main content

No project description provided

Project description

mdast.py

Simple Python bindings for the mdast functionality of wooorm/markdown-rs

Installation

pip install mdast

If you're on x86-64/AMD64 or arm64/aarch64 you can install this package without having Rust on your system. For other platforms, the rust toolchain is required to build the binary dependencies.

Usage

Converting from markdown to mdast's json format

import mdast

mdast.md_to_json("# title")
# -> {"type":"root","children":[{"type":"heading","children":[{"type":"text","value":"title","position":{"start":{"line":1,"column":3,"offset":2},"end":{"line":1,"column":8,"offset":7}}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":8,"offset":7}},"depth":1}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":8,"offset":7}}}

Converting from mdast to markdown

import mdast

mdast.json_to_md('{"type":"root","children":[{"type":"heading","children":[{"type":"text","value":"title","position":{"start":{"line":1,"column":3,"offset":2},"end":{"line":1,"column":8,"offset":7}}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":8,"offset":7}},"depth":1}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":8,"offset":7}}}')
# -> '# title\n'

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

mdast-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distributions

mdast-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

mdast-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

File details

Details for the file mdast-0.1.0.tar.gz.

File metadata

  • Download URL: mdast-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for mdast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 704a0bf9517e1ff179f3db30165027006c1f873a115e0339bce7556349dbe9a1
MD5 ac27f0b431b45bd817bf252a3abade6b
BLAKE2b-256 d348e0166c72d0177dad17e5438bfd973fbaaaf0f0ff170eda9f881c8e29a049

See more details on using hashes here.

File details

Details for the file mdast-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mdast-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4dd82b62b99d39927e1c84eedf78b9d090a5f22ef0f37510af00487e23da617
MD5 ff8ed5b4c99cd47502a6f74a9deabc12
BLAKE2b-256 5f224f7f1c9140ab4512933846fd831ae3164fdf5ddde4cb26f8ee7ba750e5ee

See more details on using hashes here.

File details

Details for the file mdast-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mdast-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9caca7579e37e6f8d05bd793b2a4a169c5f85c58c97e6bd95238e36e659f9076
MD5 427453cb35c3a78f6a9ba904d96fda73
BLAKE2b-256 d117fd879fa8acb94002859d43193b240c18e5e13056d6b7a13d7d353e0d599d

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