AI2Web (ai2w) Python SDK - capability model, manifest builder, validator, negotiation, server handler.
Project description
AI2Web Python SDK (ai2web)
The Python reference implementation of the AI2Web protocol - for Django, Flask, FastAPI, or plain Python. Mirrors @ai2web/core.
pip install ai2web
from ai2web import ai2web, validate, handle
manifest = (
ai2web({"name": "Example Store", "url": "https://example.com", "type": "ecommerce"})
.capability("content")
.capability("commerce", {"endpoint": "/ai2w/products", "checkout": True})
.transports({"mcp": {"enabled": True, "endpoint": "/ai2w/mcp"}, "rest": {"enabled": True}})
.auth({"methods": ["none", "oauth2"], "oauth2": {"pkce": True, "scopes": ["checkout"]}})
.consent({"requires_user_approval_for": ["purchase"]})
.contact({"support": "help@example.com"})
.build()
)
result = validate(manifest) # {'score': 90+, 'tier': 'Standard', ...}
# Serve every AI2Web route from one call (framework-agnostic):
res = handle({"manifest": manifest}, method, path, body, origin)
Modules
ai2web.manifest- fluent capability-model builder (ai2web(...),Manifest).ai2web.validator-validate()+ AI Readiness scoring (spec §9/§11).ai2web.negotiator-negotiate()capability negotiation (spec §5).ai2web.server-handle()framework-agnostic route handler.ai2web.safety-is_safe_public_url()/assert_safe_public_url()SSRF guard.
Test
python tests/run.py # dependency-free; includes the shared conformance contract
Requires Python 3.9+. Zero runtime dependencies.
Licence
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 ai2web-0.2.1.tar.gz.
File metadata
- Download URL: ai2web-0.2.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3a495e98bac4a419cfe08e3e46514d0d41f09dc23e04b5430d692acfd7ea0d1
|
|
| MD5 |
dec796c4ef7c98b0d8a3d1b627dfce58
|
|
| BLAKE2b-256 |
b5d18e2198ef592365ab64844e572eda143d3ddc41a71b0cdeaf56853fe07f44
|
Provenance
The following attestation bundles were made for ai2web-0.2.1.tar.gz:
Publisher:
publish.yml on ai2web-foundation/ai2web-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai2web-0.2.1.tar.gz -
Subject digest:
a3a495e98bac4a419cfe08e3e46514d0d41f09dc23e04b5430d692acfd7ea0d1 - Sigstore transparency entry: 2183850447
- Sigstore integration time:
-
Permalink:
ai2web-foundation/ai2web-python@c7fb78734a3030ebeb7bde1923ec87f16d0a9973 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ai2web-foundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7fb78734a3030ebeb7bde1923ec87f16d0a9973 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ai2web-0.2.1-py3-none-any.whl.
File metadata
- Download URL: ai2web-0.2.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6246602fb9b84fef7590f87e6f029b9265f98dd617bee9c4658b157b87839e86
|
|
| MD5 |
ed4046b61be31bf628c0ab9e9811bc62
|
|
| BLAKE2b-256 |
be1d4c8fb5ccdda48513f383bbab3d246fd5e30c09fd4223afd17b8c6a55986c
|
Provenance
The following attestation bundles were made for ai2web-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on ai2web-foundation/ai2web-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai2web-0.2.1-py3-none-any.whl -
Subject digest:
6246602fb9b84fef7590f87e6f029b9265f98dd617bee9c4658b157b87839e86 - Sigstore transparency entry: 2183850576
- Sigstore integration time:
-
Permalink:
ai2web-foundation/ai2web-python@c7fb78734a3030ebeb7bde1923ec87f16d0a9973 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ai2web-foundation
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c7fb78734a3030ebeb7bde1923ec87f16d0a9973 -
Trigger Event:
release
-
Statement type: