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.0.tar.gz (238.2 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.0-cp39-abi3-win_arm64.whl (5.8 MB view details)

Uploaded CPython 3.9+Windows ARM64

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

Uploaded CPython 3.9+Windows x86-64

webspec_index-0.13.0-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.0-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.0-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.0-cp39-abi3-macosx_11_0_arm64.whl (6.4 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

webspec_index-0.13.0-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.0.tar.gz.

File metadata

  • Download URL: webspec_index-0.13.0.tar.gz
  • Upload date:
  • Size: 238.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.0.tar.gz
Algorithm Hash digest
SHA256 a7a1c7d449e6584496eb7e638c249171755c5b4be1a4604a8532c1a9e0627fbc
MD5 5137f371a0c36f06bb9453add23755ba
BLAKE2b-256 5c38f4066b23e82012980cad28b1f1ea204c879426047d1f48b6bcf377a12ff5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.13.0-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.3 {"installer":{"name":"uv","version":"0.12.3","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.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 8bdbc9c2fc43526ccfdb4ffae651a8d664586f122e59d1a1bce2a248c1863a19
MD5 57c10da71d6a0a23408120c2ada370a4
BLAKE2b-256 2cdcc54e4e3ece1fa5c9f8fda8df3c64ca3de6f5f300a8976b3795a36c9d3b5d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.13.0-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.3 {"installer":{"name":"uv","version":"0.12.3","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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c54e973423332728a5b3632b8dc061755106e4981b059ced29846b807341b914
MD5 36f5e6243b1ee6fba3f70e4167053a88
BLAKE2b-256 f2d932c82a5aeabf2a06a9f2046d792d2ca8c84ff46b4162c19b36bf97e4b3c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.13.0-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.3 {"installer":{"name":"uv","version":"0.12.3","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.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dc6b7790f50bc9e277c0051383c25d93dceca9e7a1cfe6772879d8c1436f11db
MD5 019d753856918f3e80af65a67fce8da5
BLAKE2b-256 3bed3e819862e545a3ea5d4919817671b23ac9d2b3c1c512ae9e30922c58c973

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.13.0-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.3 {"installer":{"name":"uv","version":"0.12.3","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.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fd8dd3877d5290acab80edf108447ca638848aabb6c4cddb7e9da016653583d
MD5 2627126d7f5d3e9c560199e7056ee2ff
BLAKE2b-256 3939e4e3e68d0010a61217bea2d3fff04cf1a05f52d82da4aac8171945bdbe39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.13.0-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.3 {"installer":{"name":"uv","version":"0.12.3","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.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 99f8e0d60c00701cda59acf810fcea701b4e39f823ef151e3e3ed45bf0ed3aa8
MD5 ee42c31f3bb50ddcfda8393871bd8ded
BLAKE2b-256 6474b08e367b3d87e53e30b0e0abf402929cd070a6195b15a443751e5b602225

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.13.0-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.3 {"installer":{"name":"uv","version":"0.12.3","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.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6adbd3bc2db3c62330903bd0cb8e55b59957a1c17c7a46c388dffe5c6182ae60
MD5 79a5b118bfbf85e6662f09e72d4c2190
BLAKE2b-256 d23c2df5955d09fd52e5a05c65451a9bcb0d1abeb751be38f5a448b4de5e8924

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.13.0-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.3 {"installer":{"name":"uv","version":"0.12.3","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.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 63346b70dc8701905c973a042e142aeb02481d4ca6e218c70b05037de5d19f77
MD5 47bf557c1ea1bc15bf44f1b79e83cd31
BLAKE2b-256 78b3b92ca3f5ba038f930685c5712427eae85192120009b2b380b3f38a803a4b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.13.1

8 files

This release

0.13.0 This release

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