Skip to main content

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

webspec_index-0.9.0.tar.gz (176.9 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.9.0-cp39-abi3-win_arm64.whl (5.1 MB view details)

Uploaded CPython 3.9+Windows ARM64

webspec_index-0.9.0-cp39-abi3-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.9+Windows x86-64

webspec_index-0.9.0-cp39-abi3-musllinux_1_2_x86_64.whl (6.8 MB view details)

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

webspec_index-0.9.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view details)

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

webspec_index-0.9.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

webspec_index-0.9.0-cp39-abi3-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

webspec_index-0.9.0-cp39-abi3-macosx_10_12_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: webspec_index-0.9.0.tar.gz
  • Upload date:
  • Size: 176.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0.tar.gz
Algorithm Hash digest
SHA256 d1abfc257c25d0946ad4b4fe47e519a710bb4ae87699e0e7965653f109db41ee
MD5 ef98b160f91d30ab202ffbed912fecc5
BLAKE2b-256 082c6e440e2fbda33143a0d48a49404fcfb48c4b8ba26270b5d0c2b13c87cd40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.9.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.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 7f63d6c75d7494ece3e9e4de7dbbf11eb7cbdbcaa19761e7603471fbbb606a6c
MD5 5130032c22fdc885de278cbdffce18e3
BLAKE2b-256 4a5199f89f07cd8cc7e9e420d0dcc80bd21577b002b07d1ac24852120a2e2e90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.9.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.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0ecf7fd5aaee9dc9b75f9c55891d9bb70856c9e6b8b9f20fcde5027f8a0a57da
MD5 7dfdc93020381daaa167faea1fc76142
BLAKE2b-256 793797ed3af673dcb9aaede1de2dc20bc321252b18dda7e1129322978d74ff13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.9.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.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 630c997cbd851bd5255fb992cfd1614a6715ce5ca88076b92b04231f7fce9089
MD5 deb355fbf7911119ef2420cb80247fc1
BLAKE2b-256 21cf74dcb6bb77a2142f9fb4d554bfec8a43220236e10179d9e883c7cb5f1d11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.9.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.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d078b32896178f1f12edd7fa610d48b8160c4f31fa0df5476c3473f8e297dec
MD5 b7b9788e7cbf192f51616e35abe6be39
BLAKE2b-256 dc36626a1575c857c2e4307edb7f55e116ec994ce5e3fb9669a07fa94c38d5e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.9.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.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1a6377ef3e87cdc7008f0fe42eca2632125baba3ba379cfcd9672bfd756de047
MD5 469659ef23928128c852e1a5bbae5a89
BLAKE2b-256 4c617c57e6549eefe3f713f843dcabde300d1c1c98d38fa2090b74793b8f012b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.9.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 090515df6fff3a711eff5fa64dd5b15f1ce3c7cf71ea49a61a626cbfa4cdde14
MD5 79e4a4f92430d4bd295569b8b4d9793d
BLAKE2b-256 a0d0e5a85bf3b641333a1b5b1c1cee0bf5a1b4bb24d4f74af63e12136f9dae52

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.9.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.21 {"installer":{"name":"uv","version":"0.11.21","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.9.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 49befb8ef3171ef6dd1cb74dbd22af84cceba085d0623ff309f8aa7bf9621a6f
MD5 c673c9ab86280da6d12501065911eef0
BLAKE2b-256 aa5cfb76d821e028ca591c2825e2aa9c63c01c28abae78fde76d9a496491caa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page