Skip to main content

turbo-surf (Python)

Browserless, native-speed web crawler + extractor with a real V8 JS-render tier — a PyO3 binding over the turbo-surf Rust engine. Fetch-free: you pass a page's HTML in, and get a view out (Markdown, visible text, links, a typed extraction, an accessibility tree). For JS-gated pages, the engine runs the page's own scripts in a true V8 isolate over a native DOM — no headless Chromium.

import turbo_surf as ts

html = open("page.html").read()

ts.markdown(html, base_url="https://example.com/")   # -> Markdown str
ts.text(html)                                        # -> visible text
ts.links(html, base_url="https://example.com/")      # -> list[str]

# Typed extraction: a JSON schema maps field names to selector specs.
schema = '{"title": {"selector": "h1"}, "prices": {"selector": ".price", "list": true}}'
ts.extract(html, schema, base_url="https://example.com/")   # -> JSON str

# JS-gated page: run its own scripts, read the hydrated DOM.
hydrated = ts.render(html, script, base_url="https://example.com/")

Fatal faults (malformed schema JSON, a render-tier failure) raise turbo_surf.TurboSurfError; the non-JS views never raise.

Install

pip install turbo-surf

Prebuilt abi3 wheels (CPython 3.8+) are published for Linux (x86_64/aarch64), macOS (arm64), and Windows (x64). Linux wheels require glibc 2.28 or later (manylinux_2_28). The CPython 3.8+ abi3 contract is unchanged; it does not imply compatibility with older Linux C libraries.

Source builds and feature profile

Use Rust 1.98.0 and maturin (the build backend requires >=1.9.3,<2.0; release CI uses 1.15.0). From the repository root:

maturin build --release --manifest-path rust/crates/turbo-surf-py/Cargo.toml
# Or install into an active virtual environment:
maturin develop --release --manifest-path rust/crates/turbo-surf-py/Cargo.toml

The crate defaults to avif and jxl screenshot pixel decoders. Its independent resource client uses reqwest/rustls: view/render disable core's default impersonation feature. A workspace build that also selects MCP/NAPI can unify BoringSSL back in, so validate a standalone wheel separately. Native V8 and C++20 audio still need their build toolchains; this is not a pure-Python wheel.

pyproject.toml enables pyo3/extension-module for wheel construction, while the crate selects abi3-py38. Keep the extension-module feature out of ordinary workspace test/link assumptions. The Python test extra installs pytest; it does not change the engine's Cargo features.

Optional gpu-metal, coretext and native-sdk-frame-read forward to the raster/render crates. They are off in the stock wheel workflow. Python exposes synthetic raster screenshot functions, but its current evaluate/render initialization does not install guest canvas or WebGL execution callbacks. Enabling a raster feature alone therefore does not establish a guest GPU bridge. See Build features for all defaults, forwarding, platform/toolchain requirements and GPU bridge for the execution boundary.

API

function returns notes
markdown(html, base_url="") str Markdown render
text(html) str visible text
title(html) str document <title>
html(html) str re-serialized HTML
links(html, base_url="") list[str] resolved hyperlink targets
interactive_elements(html, base_url="") JSON str links/buttons/inputs
accessibility_tree(html) JSON str a11y tree
hydration_state(html) JSON str hydration probe
detect(html) JSON str is the page JS-gated?
query(html, selector, kind=None) JSON str kind = "css"/"xpath"/auto
extract(html, schema_json, base_url="") JSON str typed extraction
evaluate(html, script) str run script over the DOM (sync)
render(html, script, base_url="") str hydrated HTML after page scripts run
transform(src, ts=False, jsx=False) str TS/JSX → classic JS (swc)

MIT licensed.

Metadata

Release files for turbo-surf 0.8.4

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

Source distribution (sdist)

Source distribution for turbo-surf 0.8.4
File Size Uploaded Provenance Actions
turbo_surf-0.8.4.tar.gz 2.2 MB Without provenance Details for turbo_surf-0.8.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for turbo-surf 0.8.4
File Actions
turbo_surf-0.8.4-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for turbo_surf-0.8.4-cp38-abi3-win_amd64.whl
turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_x86_64.whl CPython 3.8 abi3 Linux glibc 2.28+ x86-64 Details for turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_x86_64.whl
turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_aarch64.whl CPython 3.8 abi3 Linux glibc 2.28+ ARM64 Details for turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_aarch64.whl
turbo_surf-0.8.4-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for turbo_surf-0.8.4-cp38-abi3-macosx_11_0_arm64.whl

Total release size: 197.0 MB

Release files / turbo_surf-0.8.4.tar.gz

Download URL turbo_surf-0.8.4.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
4febf46a7494708e6de519ba25e71e5aa57f09bbcc8d6724c85a4f5b61c4aa1e
BLAKE2b-256 checksum
How to use checksums
416c2d645d048440d041fe53df5367215541c7c79f2ec23b5b53cee202a31fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / turbo_surf-0.8.4-cp38-abi3-win_amd64.whl

Download URL turbo_surf-0.8.4-cp38-abi3-win_amd64.whl
Size 45.6 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
dfbfbbd2723a0d024bce4c77b524ee6e238ad944afcc170fc60ac96489a6fd25
BLAKE2b-256 checksum
How to use checksums
b147ccef25e8ee49c891820bb074ee3642a7b422b3baa115c1b52723d44a8d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_x86_64.whl

Download URL turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_x86_64.whl
Size 50.2 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
fb68b5df71c7d7d55008b3d7dbeb60cebae0e60661677c792b72c8085a92c25f
BLAKE2b-256 checksum
How to use checksums
b3a323c75bf941b4a941652d535e5e78de4ce268befc1b185b14cee9899ce8d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_aarch64.whl

Download URL turbo_surf-0.8.4-cp38-abi3-manylinux_2_28_aarch64.whl
Size 52.5 MB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
032af473d716fb856edfb61d14bc0657402272864c607cfff2e2a3871b4b73b9
BLAKE2b-256 checksum
How to use checksums
6232e3d1f58120d8e0e0e9fae78cf7b6b992aaa69e7b2eb58fc153f874d15415
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / turbo_surf-0.8.4-cp38-abi3-macosx_11_0_arm64.whl

Download URL turbo_surf-0.8.4-cp38-abi3-macosx_11_0_arm64.whl
Size 46.6 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a67451790a6973e8cdfedbc50cbaa47a04a0294cf7345082a7ebae2df28a8bae
BLAKE2b-256 checksum
How to use checksums
a1c24170a41c076862635d4f77332be1b5488b497fc84e918bc8916ddb6c3db1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Security for turbo-surf 0.8.4

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