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.10.0.tar.gz (177.4 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.10.0-cp39-abi3-win_arm64.whl (5.1 MB view details)

Uploaded CPython 3.9+Windows ARM64

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

Uploaded CPython 3.9+Windows x86-64

webspec_index-0.10.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.10.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.10.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.10.0-cp39-abi3-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

webspec_index-0.10.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.10.0.tar.gz.

File metadata

  • Download URL: webspec_index-0.10.0.tar.gz
  • Upload date:
  • Size: 177.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0.tar.gz
Algorithm Hash digest
SHA256 b7a96ecf3be522c99a02824d553848f72d63666660a4921ec94e30937097abe2
MD5 d8a3d0177e8f781aec6d11392ac81cf7
BLAKE2b-256 407890272e40d80caca65d2ad3ee869d4990bdc65985c5a4824218c811414918

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.10.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.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 f3ad4dbf0428cc90340d9530d00ae86c9c6831be682374401be9c2dadba41fbf
MD5 299cc14489836b49a0d2588b14cf6767
BLAKE2b-256 d08a971bc2f9388d31c9578f577def50521df8610c002d9f30795bf8926cf7be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.10.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.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 45470703c64054191ee3ecc6ce77dde1b29d256a8a577fa6b4a5eb4badfff01a
MD5 138e8b5af80af4f4ed0176f9ab0e8416
BLAKE2b-256 b2ad3b96855068af5fb6dd7ffe21d59b0238be5055253b6875396aaaf9bca742

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.10.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.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2674ac3bdb13168fec80a52aacd22a6de6844d9f93741994e6cc5069ffb16494
MD5 d68053514e11369d8ca57327f7528174
BLAKE2b-256 438f1ac06a06bb3a731bed7d212c3e719425d59fc2fcfa027996167f54aeeb67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.10.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.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b6118f283a8cfd35ddec50c97f9ecde828c9662cbdf5427505eed4f86d7717e1
MD5 6877f008fde9553c419c9889a4e44c68
BLAKE2b-256 a6349d4010d8e54b405e68776061df884d037837e2df090daa0513e138d4a072

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.10.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.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 39f702202c0e677ed39b7f660ce016c645726810533358b9c6a446c0f6410ab8
MD5 b8d4a62743bad900a62a447067031c9d
BLAKE2b-256 fe8a36e3d6510cb5a0d879099e1263c8fe12923506c81929f93d85e621b5e739

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.10.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.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be915797c8d88c73bae0a4057b563da7a87ff87dc2e845d3e3bd4fa6953e443b
MD5 61c5fd28318baff496c550e507e50ded
BLAKE2b-256 f418ba80b8956de04f21d4b148dfb6c66ebc9d9881a0eb7a564fdd8f7a1a0e72

See more details on using hashes here.

File details

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

File metadata

  • Download URL: webspec_index-0.10.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.24 {"installer":{"name":"uv","version":"0.11.24","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.10.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 407683d304c64282e526f011a85faf222a50b23a4596119663f287ac946a8d82
MD5 f34c20564b00e35890c96a3f82fb735b
BLAKE2b-256 0357da14170349e04a097dfc450114400d25619a72b80e288bd99ed76cdd8b66

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