Skip to main content

oxide_parse

PyPI CI MIT license

Declarative HTML and JSON extraction engine in Rust with a Python API: you describe a schema with T, compile it to a JSON-serializable IR, and run it in a single streaming pass or over a DOM.

Three things that set it apart:

  • Streaming engine (stream) without a DOM: common schemas (catalogs, metadata, embedded JSON) run in a single pass over bytes, keeping only the open tag stack and extracted values in memory.
  • Schema as serializable IR: save any plan to JSON or YAML (to_json()) and turn it back into plain Python (to_python()).
  • Zero-IO Session: the core never performs network requests or LLM calls — it yields URLs (follow, paginate) and broken selectors (adaptive + repair_batch) to your sync or async code.

Installation

pip install oxide-parse

From source (Rust 1.74+ and Python 3.9+):

uv sync && uv run maturin develop --release --features full

Quick Example

from oxide_parse import T, compile

html = """
<html><body>
  <h1>Laptops</h1>
  <script id="__NEXT_DATA__" type="application/json">{"currency": "USD"}</script>
  <div class="card"><h2>ThinkPad X1</h2><span class="price">$1,299.50</span></div>
  <div class="card"><h2>Broken</h2><span class="price">out of stock</span></div>
</body></html>
"""

schema = {
    "title": T.css("h1").text(),
    "currency": T.css("script#__NEXT_DATA__").text().parse_json()["currency"],
    "items": T.css(".card").map({
        "name": T.css("h2").text(),
        "price": T.css(".price").text().float(),
    }, on_error="skip"),
}

plan = compile(schema, backend="auto")
data = plan.extract_detailed(html)
print(plan.engine, data.data, data.errors, sep="\n")
stream
{'title': 'Laptops', 'currency': 'USD', 'items': [{'name': 'ThinkPad X1', 'price': 1299.5}]}
[{'path': '$.items[1].price', 'message': 'float: no number in "out of stock"'}]

Choosing an Engine

backend= Kind When to use DOM XPath :scope adaptive
auto automatic almost always (stream, falls back to DOM when needed) as needed yes yes yes
stream streaming catalogs, <head> metadata, large pages no no yes no
lite arena DOM complex CSS, :contains(), XPath, distill() yes yes yes yes
scraper html5ever DOM malformed HTML needing exact HTML5 tree rules yes yes no yes
json data same schemas over JSON documents no no no no
xml XML DOM XML documents and XPath selectors yes yes no no

Highlights

Hybrid HTML + JSON (__NEXT_DATA__, JS state, JSON-LD, OpenGraph):

hy_html = '<head><meta property="og:title" content="X1"></head><script id="s">window.__S__={"n":3}</script>'
hy_schema = {"og": T.meta_tags(values="first")["og:title"], "n": T.css("script#s").text().js_json("window.__S__")["n"]}
print(compile(hy_schema, backend="auto").extract(hy_html))
{'og': 'X1', 'n': 3}

Self-healing selectors & Python code patching (adaptive + extract_or_repair + to_python()):

p_adapt = compile({"price": T.css(".price", adaptive="price").text().float()})
p_adapt.extract('<div id="p1"><span class="price">$100</span></div>')
res = p_adapt.extract_or_repair('<section><div><strong class="cost">$95</strong></div></section>', repair=lambda _: {"price": ".cost"})
print(res.data, res.plan.to_python().splitlines()[-2].strip())
{'price': 95.0} 'price': T.css('.cost', adaptive='price').text().float(),

Zero-IO follow / paginate and Rayon extract_batch (GIL released):

from oxide_parse import follow, paginate

pages = {"https://ex.test/1": "<b>42</b><a class='next' href='/2'>n</a>", "https://ex.test/2": "<b>9</b>"}
f_plan = compile({"vals": follow(T.css("a").attr("href").url(), paginate(T.css("b").map(T.text().int()), T.css("a.next").attr("href").url()))})
print(f_plan.extract('<a href="/1">x</a>', meta={"base_url": "https://ex.test"}, fetch=lambda url, **_: pages[url]))
print(compile({"n": T.css("b").text().int()}, backend="auto").extract_batch(["<b>1</b>", "<b>x</b>"], errors="collect"))
{'vals': [42, 9]}
([{'n': 1}, None], [{'index': 1, 'message': 'extraction error at `$.n`: int: no number in "x"'}])

LLM preparation (distill, markdown) and deterministic migration without an LLM:

from oxide_parse import distill, markdown, migrate

print(markdown("<article><h1>Title</h1><p class='ad'>Ad</p><p>Text</p></article>", "article", without=".ad"))
print(migrate.from_selector_map_code({"title": "h1::text", "tags": ["li::text"]}).splitlines()[-3].strip())
# Title

Text
'title': T.css('h1').text().strip(),

Benchmark Summary

Medians on Windows x64, Python 3.13 (details, versions, and methodology in docs/architecture/benchmarks.md and benchmarks/):

Scenario oxide_parse Nearest competitors Run
Catalog 10,000 items + noise (6.2 MiB) stream 71.9 ms, lite 103.1 ms frostwork 127.5 ms, selectolax 445.1 ms, bs4+lxml 8659.6 ms v7.2 full
Early Exit (og:title from <head>, 875 KiB) auto (stream) 1.43 ms scraper (v8.4.1 pre-stream meta) 81.89 ms v8.5 paired
Hybrid HTML + __NEXT_DATA__ (1,000 records) lite 4.34 ms, stream 6.05 ms selectolax + json.loads 2.45 ms, lxml + json.loads 5.17 ms v8.0 full
Batch 32 docs x 500 items (9.8 MiB) stream (Rayon) 51.6 ms stream (loop) 121.7 ms, selectolax (loop) 487.7 ms v8.0 full
HTML to Markdown (300 blocks) lite 1.51 ms, scraper 7.26 ms html2text 140.5 ms, markdownify 197.4 ms v8.5 paired

Documentation

Section Links
Docs map docs/index.md
Guides Quickstart · DSL Cheatsheet · Choosing Engine · HTML + JSON · Adaptive & Repair · Follow & Pagination · RAG & Migration
AI prompts Generate Schema · Migrate Parser · Self-Healing Repair
Reference Python API · IR Specification · CSS & XPath · CLI
Core & tests Architecture · Conformance · Benchmarks · Publishing · CHANGELOG
LLM indexes llms.txt · llms-full.txt · CLAUDE.md

Report bugs in GitHub Issues. Use the security policy to report vulnerabilities privately.

Metadata

Release files for oxide-parse 0.9.1

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

Source distribution (sdist)

Source distribution for oxide-parse 0.9.1
File Size Uploaded Provenance Actions
oxide_parse-0.9.1.tar.gz 262.1 kB Without provenance Details for oxide_parse-0.9.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for oxide-parse 0.9.1
File Actions
oxide_parse-0.9.1-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for oxide_parse-0.9.1-cp310-abi3-win_arm64.whl
oxide_parse-0.9.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for oxide_parse-0.9.1-cp310-abi3-win_amd64.whl
oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_x86_64.whl
oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_aarch64.whl
oxide_parse-0.9.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for oxide_parse-0.9.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
oxide_parse-0.9.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for oxide_parse-0.9.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
oxide_parse-0.9.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for oxide_parse-0.9.1-cp310-abi3-macosx_11_0_arm64.whl
oxide_parse-0.9.1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for oxide_parse-0.9.1-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 16.8 MB

Release files / oxide_parse-0.9.1.tar.gz

Download URL oxide_parse-0.9.1.tar.gz
Size 262.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c2127a70fd3220d04a3a92d8146549ca0e844024e693083d8308d0680fc3ac9b
BLAKE2b-256 checksum
How to use checksums
cc01e26b24323ae198e45f1f31e83ef6351fb916203c0f4d40a7dff85864a4e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-win_arm64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-win_arm64.whl
Size 1.8 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
55123660bd7890c9b8edd9a9479c5683bccdbc97df163ad47d91bd7d1f6db554
BLAKE2b-256 checksum
How to use checksums
43235f1c348e0b037fde1041b8ddb27bfa4ef636d39436453a4422061233f8fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-win_amd64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-win_amd64.whl
Size 1.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4fef859ce4f6656f72d7593713ca261173f9b37c90279238308d4c6dc0aa3255
BLAKE2b-256 checksum
How to use checksums
baafd79e847b9f02a40aaf52e36a6a2980c8776b7b038ba02788136028418c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_x86_64.whl
Size 2.4 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
ea85a93665609b2501edea82dd2800734a4e45731cea814429bf3387d67898ef
BLAKE2b-256 checksum
How to use checksums
9f47790e0592d9e8a7900b9253beffa2ab8b9d1ff688cc3100199409fdd7e0be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-musllinux_1_2_aarch64.whl
Size 2.3 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
4010efeb3313e4e22324b0a0ed81ed0a1b29766f66a54657b02bf8503c9b01e0
BLAKE2b-256 checksum
How to use checksums
ba9887fb493645224cc67d1b2bfb8b7c24fa7b27fbf5820a21fe9a502e292a83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c7405807b69368c5ced953edfa89f4a5919d2aa59985b993837c1e86e8a01abe
BLAKE2b-256 checksum
How to use checksums
573a4fdc27064320ccbfe52f5861f544cfb66d53fc89647a00d3a564552cd6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b3551a24ac2771cd0222fc04b69aa71e53d7e1e7112d806981fd60ebd041e613
BLAKE2b-256 checksum
How to use checksums
a2513bdc5898d1c38e7a8b7555acc780b31f2d57d870b96b2273b6b08c646582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-macosx_11_0_arm64.whl
Size 1.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
45cdf88171ab51a70f2bde8515b432fcd8629e278478630505fdb9862cb9946c
BLAKE2b-256 checksum
How to use checksums
0cd1b6ff3d92a25929bc1cba165be64648769e60b0d266b1bb7a61d6cad47d6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / oxide_parse-0.9.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL oxide_parse-0.9.1-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1703944074335c5d931be091f730c33f4531736aef993266fc2a6c1238808588
BLAKE2b-256 checksum
How to use checksums
9debdd1cfcdb42cf2c198159752424ba99c971c0b6eaa6a4f16e25271c00cc84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for oxide-parse 0.9.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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