Metadata-Version: 2.4
Name: octivas
Version: 0.1.0
Summary: Python client for the Octivas web scraping and extraction API
Project-URL: Homepage, https://github.com/octivas/octivas-python
Project-URL: Documentation, https://docs.octivas.com
Project-URL: Repository, https://github.com/octivas/octivas-python
Author: Octivas
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
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: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2.0
Provides-Extra: dev
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-httpx>=0.34; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# Octivas Python SDK

The official Python client for the [Octivas](https://octivas.com) web scraping and extraction API.

## Installation

```bash
pip install octivas
```

## Quick start

```python
from octivas import Octivas

client = Octivas(api_key="oc-...")

# Scrape a single page
result = client.scrape("https://docs.octivas.com")
print(result.markdown)

# Crawl a website
crawl = client.crawl("https://docs.octivas.com", limit=20)
for page in crawl.pages:
    print(page.url, page.metadata.title)

# Search the web
search = client.search("python web scraping", limit=5)
for item in search.results:
    print(item.title, item.url)
```

## Async usage

```python
from octivas import AsyncOctivas

async with AsyncOctivas(api_key="oc-...") as client:
    result = await client.scrape("https://docs.octivas.com")
    print(result.markdown)
```

## Batch scraping

```python
client = Octivas(api_key="oc-...")

job = client.batch_scrape(["https://docs.octivas.com", "https://octivas.com"])
status = client.batch_scrape_wait(job.job_id)

for result in status.results:
    print(result.url, len(result.markdown or ""))
```

## Error handling

```python
from octivas import Octivas, AuthenticationError, RateLimitError

client = Octivas(api_key="oc-...")

try:
    result = client.scrape("https://docs.octivas.com")
except AuthenticationError:
    print("Invalid API key")
except RateLimitError:
    print("Too many requests - back off and retry")
```

## Configuration

```python
client = Octivas(
    api_key="oc-...",
    base_url="https://api.octivas.com",  # default
    timeout=60.0,                         # seconds
)
```
