Metadata-Version: 2.4
Name: manifest-api
Version: 0.1.1
Summary: Python SDK for the Manifest API — structured action manifests for AI agents
Project-URL: Homepage, https://omfang.io/docs
Project-URL: Repository, https://github.com/omfang/manifest-api
Project-URL: Bug Tracker, https://github.com/omfang/manifest-api/issues
Author-email: Omfang AB <hello@omfang.io>
License: MIT
Keywords: agents,ai,automation,browser,manifest,web
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# manifest-api

Stop guessing selectors. Manifest tells your agent what's clickable, fillable, and submittable on any page.

Python SDK for the [Manifest API](https://omfang.io/docs) — extracts structured action manifests from web pages so AI agents know *what they can do*, not just what's on screen.

| | Raw browser access | Content extraction | Manifest |
|---|---|---|---|
| Gives agents a browser | ✓ | ✗ | ✓ |
| Returns page content | ✓ | ✓ | ✓ |
| Returns available actions | ✗ | ✗ | ✓ |
| Required fields, input types | ✗ | ✗ | ✓ |
| Survives UI redesigns | ✗ | ✓ | ✓ |

## Install

```bash
pip install manifest-api
```

## Quickstart

### Sync

```python
from manifest_api import ManifestClient

client = ManifestClient(api_key="your-key")  # or set MANIFEST_API_KEY env var
manifest = client.get("https://example.com")

print(manifest.current_page_state)
print(manifest.actions)

# Convenience helpers
action = manifest.action("submit-form")
inputs = manifest.actions_of_type("input")
required = manifest.required_actions
```

### Async

```python
import asyncio
from manifest_api import AsyncManifestClient

async def main():
    async with AsyncManifestClient(api_key="your-key") as client:
        manifest = await client.get("https://example.com")
        print(manifest.current_page_state)

asyncio.run(main())
```

## All methods

```python
# Both ManifestClient and AsyncManifestClient expose:
manifest = client.get("https://example.com")   # POST /manifest → Manifest
health   = client.health()                      # GET  /health → dict
valid    = client.session_valid()               # GET  /session-status → bool
```

## Manifest helpers

```python
manifest.action("id")              # → Action | None
manifest.actions_of_type("input")  # → list[Action]
manifest.required_actions          # → list[Action]
```

## Action types

`button` · `input` · `textarea` · `select` · `checkbox` · `radio` · `other`

## Error handling

```python
from manifest_api import AuthenticationError, RateLimitError, APIError

try:
    manifest = client.get("https://example.com")
except AuthenticationError:
    print("Check your API key")
except RateLimitError:
    print("Slow down — rate limit hit")
except APIError as e:
    print(f"Server error {e.status_code}")
```

## Docs

[https://omfang.io/docs](https://omfang.io/docs)
