Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

omni-mdx

A blazingly fast, headless MDX engine for Python, powered by a Rust core.

omni-mdx provides a bridge between the high-performance pulldown-cmark Rust parser and native Python applications. It parses MDX (Markdown + JSX) into a deeply manipulable Abstract Syntax Tree (AST) and offers zero-dependency native rendering solutions for both the Web (HTML/KaTeX) and Desktop (PyQt5/Matplotlib).

🚀 Features

  • Blazing Fast: The core parsing is handled by a pre-compiled Rust binary.
  • Headless AST: Manipulate Markdown and JSX tags as pure Python objects (AstNode).
  • Zero-HTML Desktop Rendering: Render rich text, complex layouts, and math equations natively in PyQt5 without relying on heavy WebEngine components.
  • Universal Math Support:
    • Generates data-math attributes for KaTeX on the web.
    • Generates native QPixmap images using Matplotlib for desktop apps.
  • Fat Wheel Distribution: The Rust binary is bundled directly into the Python package. No Rust toolchain is required for end-users.

📦 Installation

pip install omni-mdx

🛠️ Quick Start

1. Parsing MDX to AST

The core feature of omni-mdx is transforming text into a structured, easily searchable AST.

import omni_mdx

mdx_content = """
# Physics 101
The kinetic energy is defined as:
$$E_k = \\frac{1}{2}mv^2$$

<Note type="warning">Check your units!</Note>
"""

# Parse the text into a list of AstNode objects
ast = omni_mdx.parse(mdx_content)

# Easily search the AST
math_blocks = [n for n in ast.nodes if n.node_type == "BlockMath"]
print(math_blocks[0].content) # Output: E_k = \frac{1}{2}mv^2

2. Web Rendering (HTML)

Generate clean, highly customizable HTML, perfectly suited for modern web frameworks like Next.js or FastAPI.

from omni_mdx import HtmlRenderer, parse

ast = parse("<Speaker name='Leon'>Welcome to the show.</Speaker>")

# Register custom rendering logic for JSX components
def render_speaker(node, ctx):
    name = node.attr_text("name")
    return f'<div class="speaker-tag">{name}</div><p>{node.text_content()}</p>'

renderer = HtmlRenderer(components={"Speaker": render_speaker})
html_output = renderer.render(ast.nodes)

3. Native Desktop Rendering (PyQt5)

Render MDX content directly into native Qt Widgets. Math equations are seamlessly converted to high-quality images via Matplotlib.

from omni_mdx.qt_renderer import QtRenderer

ast = parse("# Hello\\nNative rendering without WebViews!")
renderer = QtRenderer()
widget = renderer.render(ast.nodes, parent=window)

🧠 Advanced AST Manipulation

Because the parser generates a typed AstNode tree, it is an ideal tool for large-scale text analysis, data extraction, or automated moderation.

For instance, when processing researcher submissions or generating structured vocal datasets for distinct podcast series, you can programmatically extract specific nodes while ignoring the rest of the document formatting:

from omni_mdx import parse

script = """
# Episode 4: Quantum Mechanics

<Speaker name="Dr. Aris" voiceId="v2">
We must look closer at the probability wave.
</Speaker>

<Speaker name="Leon" voiceId="v1">
Are you certain?
</Speaker>
"""

ast = parse(script)

# Extract dialogue for Text-To-Speech (TTS) dataset generation
dataset_entries = []
for node in ast.nodes:
    if node.node_type == "Speaker":
        dataset_entries.append({
            "character": node.attr_text("name"),
            "voice_profile": node.attr_text("voiceId"),
            "text": node.text_content().strip()
        })

import json
print(json.dumps(dataset_entries, indent=2))

🏗️ Architecture

  • parser.py: High-level wrapper calling the Rust _core.pyd binary.

  • ast.py: Python dataclasses representing the parsed nodes and attributes.

  • renderer.py: Web-ready HTML generator.

  • qt_renderer.py / engine.py: Native PyQt5 widget generator.

  • math_render.py: Utilites for converting LaTeX strings to Unicode or QPixmap.

Metadata

Release files for omni-mdx 0.1.18.dev1775162196

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for omni-mdx 0.1.18.dev1775162196
File Interpreter ABI Platform Actions
omni_mdx-0.1.18.dev1775162196-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for omni_mdx-0.1.18.dev1775162196-cp313-cp313-win_amd64.whl
omni_mdx-0.1.18.dev1775162196-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for omni_mdx-0.1.18.dev1775162196-cp313-cp313-manylinux_2_34_x86_64.whl
omni_mdx-0.1.18.dev1775162196-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for omni_mdx-0.1.18.dev1775162196-cp313-cp313-macosx_11_0_arm64.whl

Total release size: 2.1 MB

Release files / omni_mdx-0.1.18.dev1775162196-cp313-cp313-win_amd64.whl

Download URL omni_mdx-0.1.18.dev1775162196-cp313-cp313-win_amd64.whl
Size 627.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
20ec079851aaaed44bf9f7e9092317225316ec8650840016c0d05c16e663a58e
BLAKE2b-256 checksum
How to use checksums
068d2bedc8cb3bad62442219fbb726d70f1662a0b1fc53ee2feb25acab47b08f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

Release files / omni_mdx-0.1.18.dev1775162196-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL omni_mdx-0.1.18.dev1775162196-cp313-cp313-manylinux_2_34_x86_64.whl
Size 812.0 kB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
77e2ece9349feeda994593f2628621b550ac72e9282258f297050469290930fa
BLAKE2b-256 checksum
How to use checksums
77b975740092f760ff00131e91849a29e9ce082c6f937825355c7ca884f10653
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

Release files / omni_mdx-0.1.18.dev1775162196-cp313-cp313-macosx_11_0_arm64.whl

Download URL omni_mdx-0.1.18.dev1775162196-cp313-cp313-macosx_11_0_arm64.whl
Size 708.7 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
14bdfc64cf622d4c1fa9a2a342f4d683d8099964394f17b3ecbf1662b8afb2a6
BLAKE2b-256 checksum
How to use checksums
8e65478d6216cd49006995be3c9c7e954d37e2db2a4a908e62f7176d087da7d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

Security for omni-mdx 0.1.18.dev1775162196

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for omni_mdx-0.1.18.dev1775162196-cp313-cp313-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page