Skip to main content

webspec-index (Python bindings)

Python bindings for webspec-index — query WHATWG, W3C, TC39, and IETF web specifications: sections, cross-references, WebIDL definitions, reference graphs, full-text search, WHATWG PR previews, and source-file step-comment analysis.

The bindings wrap the same Rust core as the webspec-index CLI. All functions are synchronous; spec data is fetched and cached locally on first use.

Install

pip install webspec-index

Usage

import webspec_index as wsi

# Query a section (SPEC#anchor or a full URL)
section = wsi.query("HTML#navigate")
print(section.title, section.section_type)
for ref in section.outgoing_refs:
    print(ref.spec, ref.anchor)

# Full-text search within a spec
results = wsi.search("tree order", spec="DOM", limit=5)
for hit in results.results:
    print(hit.anchor, hit.snippet)

# Existence check
print(wsi.exists("HTML#navigate").exists)

# Anchors by glob, headings, cross-references, WebIDL, graph
wsi.anchors("*-tree", spec="DOM")
wsi.list_headings("DOM")
wsi.refs("Window.navigation", direction="incoming")
wsi.idl("Window.open()")
wsi.graph("HTML#navigate", max_depth=2)

# WHATWG PR previews
wsi.query("HTML#navigate", pr=12345)
wsi.pr_diff("HTML", pr=12345)

# Source analysis
for file in wsi.analyze("src/", recursive=True):
    print(file.file, len(file.scopes))

# Every result object is typed and also offers .to_dict() / .to_json()
section.to_dict()

Errors are raised as webspec_index.WebspecError.

Development

This project uses uv and maturin.

# from bindings/python/
uv sync --extra test     # build the extension + install test deps
uv run pytest            # run the test suite

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webspec_index-0.13.1.tar.gz (240.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

webspec_index-0.13.1-cp39-abi3-win_arm64.whl (5.8 MB view details)

Uploaded CPython 3.9+Windows ARM64

webspec_index-0.13.1-cp39-abi3-win_amd64.whl (6.2 MB view details)

Uploaded CPython 3.9+Windows x86-64

webspec_index-0.13.1-cp39-abi3-musllinux_1_2_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

webspec_index-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

webspec_index-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

webspec_index-0.13.1-cp39-abi3-macosx_11_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

webspec_index-0.13.1-cp39-abi3-macosx_10_12_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file webspec_index-0.13.1.tar.gz.

File metadata

  • Download URL: webspec_index-0.13.1.tar.gz
  • Upload date:
  • Size: 240.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1.tar.gz
Algorithm Hash digest
SHA256 6c2240d5aba49e1bac1a54b269f852c443950c8ca6ca8862faf596071cc6adfc
MD5 c90374cd4747dcfa46f5861f5d67f7ad
BLAKE2b-256 ca92a24d3cc886fa5440ba0b39e0a56e7984af1b6b97cce572f62f608dcae67e

See more details on using hashes here.

File details

Details for the file webspec_index-0.13.1-cp39-abi3-win_arm64.whl.

File metadata

  • Download URL: webspec_index-0.13.1-cp39-abi3-win_arm64.whl
  • Upload date:
  • Size: 5.8 MB
  • Tags: CPython 3.9+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 51351253a4ec05160ad95dc88ba537b5448c3bc33440f6c33f864e524c5fad06
MD5 bb22afe356d0a57978c9b0205bab4543
BLAKE2b-256 79390b634366962764df89288bfa3b00ba053ff8243b06e163b08bafa291f38e

See more details on using hashes here.

File details

Details for the file webspec_index-0.13.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: webspec_index-0.13.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b4ec0e1ed1e30cd5e9cbe9aee29e23254da4ff2b3ea548602b53963fc1b9d9f6
MD5 4070427dcfc3398fcddcfa6e3280dc77
BLAKE2b-256 e20cf2f81e900ef1711c22174177ec82ad7bac8d0ae4dec3d2eac0e17508890b

See more details on using hashes here.

File details

Details for the file webspec_index-0.13.1-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: webspec_index-0.13.1-cp39-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.9+, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 32715204ac113ceb2e1e089fb8ea070bb044e0695aaa744f7ba420d2dab13db8
MD5 1551d3d30f8ba40e175810af92328769
BLAKE2b-256 10ff33d9b9d07205aae3d66caa084ad0b99db8e7d4d3d1e1ee2b7af9ad5f1cc1

See more details on using hashes here.

File details

Details for the file webspec_index-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: webspec_index-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 7.1 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 449576073c5df89094844cabe1ae4fec7470bb6f37cd38908e9a0e7615473548
MD5 7292ea96a9d734b919a84a4f00a6ff18
BLAKE2b-256 ba2b0d0a0b92f20f816749e73e902e5c28e0fede4247d62c68263ad22f513e35

See more details on using hashes here.

File details

Details for the file webspec_index-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: webspec_index-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 7.1 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b779182057feb31b2cdbb8abcba47a9d82678b0bd3cfd83167df3e7cbf9bb7a0
MD5 8937525103dda9be72ec3f98eb68cdf5
BLAKE2b-256 16b289a97220c89d86a63552037f99c0f4fa582bd97b9facc8ae4cfa3fc551d8

See more details on using hashes here.

File details

Details for the file webspec_index-0.13.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: webspec_index-0.13.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e27767cf8dfea3b961d1174751928ce7fb75728470872226c3d69962f05ea223
MD5 416e93a1a36811e52c9496b9b7b3691e
BLAKE2b-256 604a37ddfac2711513eeccb208f9b7b097bb93a067b387116f1c8fa57f76f492

See more details on using hashes here.

File details

Details for the file webspec_index-0.13.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: webspec_index-0.13.1-cp39-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 6.7 MB
  • Tags: CPython 3.9+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for webspec_index-0.13.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c7c2cca375fdce6e6b6e629f57b98d84232d20367dcc6fc06f20ee55baa2a673
MD5 21969c134ca46e74eece0fc8af1cffa1
BLAKE2b-256 3ca5e07f064bbd2b1f546b4fbb0d62ffc4907b80ff4b153f2bc770b002329c34

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.13.1 This release

8 files

0.13.0

8 files

0.11.0

8 files

0.10.0

8 files

0.9.0

8 files

0.4.1

4 files

0.4.0

4 files

0.3.0

4 files

0.2.0

4 files

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