oxide_parse
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 |
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 |
Metadata
Release files for oxide-parse 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oxide_parse-0.9.0.tar.gz | 261.4 kB | Without provenance | Details for oxide_parse-0.9.0.tar.gz |
Built distributions (wheels)
Total release size: 16.8 MB
Release files / oxide_parse-0.9.0.tar.gz
| Download URL | oxide_parse-0.9.0.tar.gz |
|---|---|
| Size | 261.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea97bfd567089b44e1bf1581fb5abf6e4d1607a39483d0cc96b2c40df36704c2
|
|
BLAKE2b-256 checksum How to use checksums |
a901f594c45a93f2949dbd324112fc959d61499bf527a9c1d7ef2abccb6bfd17
|
| 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.0-cp310-abi3-win_arm64.whl
| Download URL | oxide_parse-0.9.0-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
637ac6fa2c7506947e1a9b6600f7723549aa7e6acae5bef4e5442be8e89a9c60
|
|
BLAKE2b-256 checksum How to use checksums |
277e28dd3fdc5039a2d548beb3043958bb9deb21aa9f5a27ee65cf63d375596e
|
| 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.0-cp310-abi3-win_amd64.whl
| Download URL | oxide_parse-0.9.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
99ba6e3d6fc88c9cebf888a492abac196eef68f60df1ab2a76c69c20ace5e023
|
|
BLAKE2b-256 checksum How to use checksums |
50c01c239d70b658736f0e13e94d7a264c3b751d2ae9f2f076fa8deab852621c
|
| 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.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | oxide_parse-0.9.0-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 |
4330230c5cfb3d9c488dd55d675e8acd59512fa6d87a21fa4725e0c1bb7ec39f
|
|
BLAKE2b-256 checksum How to use checksums |
de4d2439b663ed5be3e131a32df8e53d0e03836bb9bb7bf4c7470d00db1d69b9
|
| 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.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | oxide_parse-0.9.0-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 |
961f3fdb7f19fc0dabe064de4842b2395b2d0c68109ad1e8e53e0b19f36c7363
|
|
BLAKE2b-256 checksum How to use checksums |
0f82ab12064deca6a9b6e634ea8d8f2eacf8dc36b085056d630d774f7375e0d7
|
| 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.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | oxide_parse-0.9.0-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 |
a3da83265cae9e8a2dc6c39dc581b3d0839197a0f39506dfe6483d3580d7d82e
|
|
BLAKE2b-256 checksum How to use checksums |
2c66361c4d37c649d3367ac66a8c5f7932381c91203c33d500eef2c0f44d26a5
|
| 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.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | oxide_parse-0.9.0-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 |
9980289af038f2d241183abe9b7559fcd28d072a106a4581fddccd6d075d88f0
|
|
BLAKE2b-256 checksum How to use checksums |
0d34d5e1ed9c4857d39c380728ff7be16fccc7b06da5cd409c6074594748294c
|
| 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.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | oxide_parse-0.9.0-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 |
85297ef83a7998972210178e2b3db00b56c8dfac0c32282ccd71739b7f403eb8
|
|
BLAKE2b-256 checksum How to use checksums |
46ad203020555b8b6182dc2a3dcac6718e1942ba000861d15d329f63ca5f1d4b
|
| 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.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | oxide_parse-0.9.0-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 |
a4feca8c9dd31fc87bf79d7c1bbe7eab9ffd933c6a5f045e01aa6cc6742fb583
|
|
BLAKE2b-256 checksum How to use checksums |
5d74475ae2e2680e7154e974d285ee530795aedfb52818cc4c5a74e9e6fd8723
|
| 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.0
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.