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.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distributions

mdast-0.1.1-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.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for mdast-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f0ad998453ce9f66a31b4d2a495f6e6b757cfe131566f9652618d086bacd293e
MD5 c6dd3059787ac9a65744876aec1ade7e
BLAKE2b-256 d2a5d348989180d278fac048f03d98006b86b8729acecf0b94bd02d90a038fb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mdast-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 23baf0b285e72a47633884487b2b0f9f0f0f7c8e97a718b00da426d55d5266e2
MD5 d07250450f7dfb3f1588acb120802ca3
BLAKE2b-256 b72342680e4c60ce92b89b37a73fa24bcfbab29abd27d00adf52af6496f8a4e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mdast-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f7637f886e084c9b5513dd9d461a1ecdde26eaa1ce5b42c48026ae64f4a85c0f
MD5 62d7761a3f0657a1aa436c5d7f272aef
BLAKE2b-256 afa72290259ba5458fe9d77e28eb700985806a75125998cc0f530507ef20f181

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