Metadata-Version: 2.4
Name: arachne-sdk
Version: 0.2.2
Summary: Python SDK para a API pública do Arachne — scraping, extração, RAG, visão, áudio e mais
Author-email: Samuel Medeiros <dev@arachneseu.pet>
License: MIT
Project-URL: Homepage, https://arachne.seu.pet
Project-URL: Repository, https://github.com/Samuelfmedeiros/arachne-mcp
Project-URL: Documentation, https://github.com/Samuelfmedeiros/arachne-mcp#readme
Project-URL: Issues, https://github.com/Samuelfmedeiros/arachne-mcp/issues
Keywords: scraping,web-scraping,rag,extraction,mcp,arachne
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
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: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Provides-Extra: full
Requires-Dist: pandas>=2.0; extra == "full"
Requires-Dist: pillow>=10.0; extra == "full"

# 🕷️ Arachne SDK — Python

[![PyPI version](https://img.shields.io/pypi/v/arachne-sdk)](https://pypi.org/project/arachne-sdk/)
[![Python versions](https://img.shields.io/pypi/pyversions/arachne-sdk)](https://pypi.org/project/arachne-sdk/)
[![License](https://img.shields.io/pypi/l/arachne-sdk)](LICENSE)

**Python SDK oficial para a API pública do Arachne** — plataforma universal de extração, busca, RAG, visão computacional e transcrição de áudio.

```bash
pip install arachne-sdk
```

## 🚀 Uso rápido

```python
from arachne_sdk import Arachne

# Crie seu client com sua API key
client = Arachne(api_key="arn_sua_chave_aqui")

# 🕸️ Extrair conteúdo de uma página
result = client.extract("https://example.com")
print(result.markdown[:500])

# 🔍 Buscar na web
search = client.search("últimas notícias IA")
for r in search.results:
    print(f"{r['title']}: {r['url']}")

# 📊 Ver uso da API
usage = client.usage()
print(f"Usado: {usage.monthly_used}/{usage.monthly_limit} requisições")
```

## ⚡ Async

```python
import asyncio
from arachne_sdk import Arachne

async def main():
    async with Arachne(api_key="arn_sua_chave") as client:
        # Extração assíncrona
        result = await client.extract_async("https://example.com")
        print(result.title)

        # Busca assíncrona
        search = await client.search_async("Python SDK")
        print(f"{search.total} resultados")

asyncio.run(main())
```

## 🧰 Métodos disponíveis

| Método | Async | Descrição |
|--------|-------|-----------|
| `status()` | ✅ | Health check da API |
| `capabilities()` | ✅ | Lista capacidades do Arachne |
| `search(query, limit)` | ✅ | Busca web via DuckDuckGo |
| `scrape(url, ...)` | ✅ | Scraping de página web |
| `scrape_many(urls, ...)` | ❌ | Scraping em lote |
| `extract(url, ...)` | ✅ | Extração universal (qualquer URL) |
| `get_job(job_id)` | ✅ | Detalhes de um job |
| `list_jobs(...)` | ❌ | Lista jobs recentes |
| `delete_job(job_id)` | ✅ | Remove um job |
| `query_rag(question, kb_id)` | ✅ | Consulta Knowledge Base (RAG) |
| `analyze_image(image_url, ...)` | ✅ | Análise de imagem (OCR + VLM) |
| `transcribe(url, ...)` | ✅ | Transcrição de áudio/vídeo (Whisper) |
| `list_pipelines()` | ❌ | Lista pipelines agendados |
| `create_pipeline(url, cron, ...)` | ❌ | Cria pipeline agendado |
| `delete_pipeline(id)` | ✅ | Remove pipeline |
| `usage()` | ✅ | Estatísticas de uso |
| `plans()` | ❌ | Lista planos disponíveis |

## 📦 Instalação

```bash
pip install arachne-sdk
```

### Dependências opcionais

```bash
pip install arachne-sdk[full]  # + pandas, pillow
```

## 🔑 Obtendo uma API Key

1. Acesse [arachne.seu.pet](https://arachne.seu.pet)
2. Crie uma conta ou faça login
3. Vá em **Configurações → API Keys**
4. Gere uma nova chave (formato: `arn_...`)

## 🏗 Exemplos completos

Veja a pasta [`examples/`](examples/) para exemplos detalhados de cada funcionalidade.

## 📄 Licença

MIT
