Python bindings for webspec-index: query WHATWG/W3C/TC39/IETF web specifications
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webspec_index-0.11.0.tar.gz.
File metadata
- Download URL: webspec_index-0.11.0.tar.gz
- Upload date:
- Size: 180.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fceb1a299af89a5f0f2e0e142719e4bd4e2f5354b6c721e8767119d5ff25ecba
|
|
| MD5 |
2dc3b76721c8d6c70fbbd5252f467b69
|
|
| BLAKE2b-256 |
bc1732db03569ac651073cd48751ebd2ff427d5bf4efeb1d24b47415284f670b
|
File details
Details for the file webspec_index-0.11.0-cp39-abi3-win_arm64.whl.
File metadata
- Download URL: webspec_index-0.11.0-cp39-abi3-win_arm64.whl
- Upload date:
- Size: 5.1 MB
- Tags: CPython 3.9+, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44de379500b6a1912249b2ce888037f347666f3119c8726cb765ebd54224d8ba
|
|
| MD5 |
f8d4a46fe76f9c1b47c2515438491bdf
|
|
| BLAKE2b-256 |
32b34d0ff2989ba609931b397aafc75485ac4a53a99f8d6a1ebd9575b11325ec
|
File details
Details for the file webspec_index-0.11.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: webspec_index-0.11.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2beacab25e97cad41af94dafcf09ea834f63e4b7ff69433c7daef8fc8f0abb4
|
|
| MD5 |
339197679665f176b509a51033e15c9a
|
|
| BLAKE2b-256 |
7c4f2ad979d751d48a0e9ba62549f8ee1a8f540b6e0985ab750882fe35bd8fe5
|
File details
Details for the file webspec_index-0.11.0-cp39-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: webspec_index-0.11.0-cp39-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.9+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d92f4b343151aae71bf6416ffcedc69940b84ec9adc800fc8f7e1c687392ba5b
|
|
| MD5 |
319e8c17f85635035d4aae449a02039c
|
|
| BLAKE2b-256 |
b2b2447d412847e369c5bf6ea5dd085e9dc313f6a95f4983123558c45d848968
|
File details
Details for the file webspec_index-0.11.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: webspec_index-0.11.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 6.4 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fab8ccd89c871006b8bcd3e19dce1b8e2ba2186f42473647e4e3a0a4b55f30e1
|
|
| MD5 |
7a30c0a58d784f726c092b8c05bdf197
|
|
| BLAKE2b-256 |
e2a324e1707c9b22c4d4bc3a7350632dd189ddc719658954c813bc01e6ac4533
|
File details
Details for the file webspec_index-0.11.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: webspec_index-0.11.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 6.3 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2cb3aa72b421bcefe39e0b9fc68a69b6c0a79bd4961b4d70e95222ac4686fcc
|
|
| MD5 |
22363e5b423194a07ec6c41fd703a5d6
|
|
| BLAKE2b-256 |
f0f8b529d78b7db0f23bd7dac28fadc433e3abbd4bdb9819b427f92e41aed568
|
File details
Details for the file webspec_index-0.11.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: webspec_index-0.11.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.8 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b0a85d1f9ac578bfb070fcafaaa2da00f63a95d641d7289f20e7af5cbe247c3
|
|
| MD5 |
5491dd3e34632311c559d80a8664f8fc
|
|
| BLAKE2b-256 |
ca116cab1914133d796c3e2251e7c10c6855d1f58b14a62d484d99bf6e8b377d
|
File details
Details for the file webspec_index-0.11.0-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: webspec_index-0.11.0-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a962cbebe3e4d040c88ff6073774596e1e2ab4b1d589eedc5f0b4227ebadb3f
|
|
| MD5 |
4aed876ddb3ae09f5987c51b42ec2e26
|
|
| BLAKE2b-256 |
07d5c6793a5d1aa6cf4b983594e54e6f9fb9a1be04d12c1ef50e53a0af72a88d
|