rdx-py
Python bindings for the RDX parser via PyO3 and maturin. Parse .rdx documents at Rust speed, get plain Python dicts back.
Installation
Usage
=
# {'title': 'API Reference'}
# '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.
=
=
rdx.collect_text(ast: dict) -> str
Extract all plain text from the AST. Useful for search indexing, embeddings, and reading time estimation.
=
=
= // 200 # minutes
rdx.query_all(ast: dict, node_type: str) -> list[dict]
Find all nodes of a given type.
=
=
rdx.version() -> str
Returns the RDX parser version.
RAG / AI Pipeline Example
"""Parse RDX and split into clean text chunks by heading."""
=
=
=
=
return
Development
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.