Skip to main content

AI2Web Python SDK (ai2web)

AI2Web on Launchpadly - Product of the Week (Gold)

CI PyPI Python versions

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.
  • ai2web.export - to_llms_txt() / to_agent_json() projections of the manifest (RFC-0015).

The builder also carries the v0.2 optional modules - .governance(...), .usage_policy(...), .legal(...), .agent_identity(...), .knowledge(...) - and actions accept intent and bindings. All are additive: a minimal manifest stays valid without them.

Test

python tests/run.py     # dependency-free; includes the shared conformance contract

Requires Python 3.9+. Zero runtime dependencies.

Licence

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai2web-0.4.1.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai2web-0.4.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file ai2web-0.4.1.tar.gz.

File metadata

  • Download URL: ai2web-0.4.1.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ai2web-0.4.1.tar.gz
Algorithm Hash digest
SHA256 808aa6d02bce87bf5687b946abffe5af2ab61e5737cd6a275afba9cced06c6f5
MD5 1e327bb0d293e81f990afcad54be902b
BLAKE2b-256 bbc2bb35cce2fd85e11bf1e102504abc49b7e54c6f3b726a482ddb9efa912770

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai2web-0.4.1.tar.gz:

Publisher: publish.yml on ai2web-foundation/ai2web-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai2web-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: ai2web-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ai2web-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75d3eb6dc6f4bfa6e76db58e40df3cfec98545775f48b13d42bcc272d4f86c0a
MD5 95330f74fb2c5a208fa31fdfb018017e
BLAKE2b-256 5c02ff76e654c13932cbd7b13642da51116ae95c3d642743656c61a404ea3fda

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai2web-0.4.1-py3-none-any.whl:

Publisher: publish.yml on ai2web-foundation/ai2web-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.2

2 files

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 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