rdx-py
Python bindings for the RDX parser via PyO3 and maturin. Parse .rdx documents at Rust speed, get plain Python dicts back.
Installation
pip install rdx-parser
Usage
import rdx
ast = rdx.parse("""---
title: API Reference
---
# {$title}
<Notice type="warning">
This endpoint is deprecated.
</Notice>
""")
print(ast["frontmatter"]) # {'title': 'API Reference'}
print(ast["children"][0]["type"]) # 'heading'
API
rdx.parse(input: str) -> dict
Parse an RDX document into an AST dict.
rdx.parse_with_defaults(input: str) -> dict
Parse with built-in transforms (auto-slug headings + table of contents).
rdx.parse_with_transforms(input: str, transforms: list[str]) -> dict
Parse with selected transforms. Available: "auto-slug", "toc".
rdx.validate(ast: dict, schema: dict) -> list[dict]
Validate an AST against a component schema.
schema = {
"strict": True,
"components": {
"Notice": {
"props": {
"type": {"type": "enum", "required": True, "values": ["info", "warning", "error"]}
}
}
}
}
diagnostics = rdx.validate(ast, schema)
for d in diagnostics:
print(f"{d['severity']}: {d['message']} at line {d['line']}")
rdx.collect_text(ast: dict) -> str
Extract all plain text from the AST. Useful for search indexing, embeddings, and reading time estimation.
text = rdx.collect_text(ast)
words = text.split()
reading_time = len(words) // 200 # minutes
rdx.query_all(ast: dict, node_type: str) -> list[dict]
Find all nodes of a given type.
headings = rdx.query_all(ast, "heading")
components = rdx.query_all(ast, "component")
rdx.version() -> str
Returns the RDX parser version.
RAG / AI Pipeline Example
import rdx
def prepare_for_embedding(rdx_source: str) -> list[str]:
"""Parse RDX and split into clean text chunks by heading."""
ast = rdx.parse(rdx_source)
chunks = []
current = []
for node in ast["children"]:
if node["type"] == "heading":
if current:
chunks.append(rdx.collect_text({"type": "root", "frontmatter": None, "children": current, "position": ast["position"]}))
current = [node]
else:
current.append(node)
if current:
chunks.append(rdx.collect_text({"type": "root", "frontmatter": None, "children": current, "position": ast["position"]}))
return chunks
Development
pip install maturin
maturin develop
python -c "import rdx; print(rdx.parse('# Hello'))"
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Metadata
Release files for rdx-parser 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rdx_parser-0.1.2.tar.gz | 107.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| rdx_parser-0.1.2-cp314-cp314-macosx_11_0_arm64.whl | CPython 3.14 | CPython 3.14 | macOS 11.0+ ARM64 | Details |
| rdx_parser-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64 | Details |
| rdx_parser-0.1.2-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| rdx_parser-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details |
| rdx_parser-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
| rdx_parser-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details |
| rdx_parser-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 8.6 MB
Release files / rdx_parser-0.1.2.tar.gz
| Download URL | rdx_parser-0.1.2.tar.gz |
|---|---|
| Size | 107.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12b6d63e633c4ba465094aa8dc9483d23d788df18d977f717b0a118c0990898e
|
|
BLAKE2b-256 checksum How to use checksums |
acf53ea83789f2768993140abf2aaea7f2370e06e5ae92b6449ab26d0247f6aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency logRelease files / rdx_parser-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | rdx_parser-0.1.2-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9321d9a22f9a354eecb288431993933f5012d5e28d3c081bc9339c9160ffbbf1
|
|
BLAKE2b-256 checksum How to use checksums |
b1f1f36d8afd66215da72712459aaa6b26b3afb244f926aad155be8e1545c658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency logRelease files / rdx_parser-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rdx_parser-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
83b1aa09bb9d90fd7268094c3393af60609a833625b80669e8766e3384e1df27
|
|
BLAKE2b-256 checksum How to use checksums |
e16d482a4fdba6fdda09c05944dd657705bc0faed34c2ca570afa84782446a50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency logRelease files / rdx_parser-0.1.2-cp312-cp312-win_amd64.whl
| Download URL | rdx_parser-0.1.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d23e8bf06e61efee86723116897798b21ddc24c86bb8f7f1e0917bf634047c59
|
|
BLAKE2b-256 checksum How to use checksums |
2fc9fb118ebfbafeaeb3b85e56e202fea5c900af944adf007ad3b7df68b4b837
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency logRelease files / rdx_parser-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rdx_parser-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
25a9a6408b315a90b295eec49663bfef3f4dc1dbb71ac415781c4c8ac3750891
|
|
BLAKE2b-256 checksum How to use checksums |
95f012f72bdc70df671d7c7fb686008836b106861fd18d3c584d169c49453bc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency logRelease files / rdx_parser-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rdx_parser-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
704a88514d4d9d20c3fb1d433e0fe0e1f088ada8bb1b2eaace64802771d0547a
|
|
BLAKE2b-256 checksum How to use checksums |
bdbaf903a0f6b61db21732f7290bdc65e84669e745274428b168252a9d9f92ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency logRelease files / rdx_parser-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rdx_parser-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
4bf1351668123bc36fd5277ec9866211e1673135352bd86a0926b273355183ad
|
|
BLAKE2b-256 checksum How to use checksums |
4d3531391985fcc9c6c579f0a2978768c15192ec45899cca223baa917ccea9b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency logRelease files / rdx_parser-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rdx_parser-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6905be5e62c3558eb81418408933aa1bfc99ca5edb701101ec0aa1ac812f602a
|
|
BLAKE2b-256 checksum How to use checksums |
b24f1d65e8729f416896070a100a46729d8e59cdb421869f796ba4016ddd3a9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 11, 2026.
Transparency log