Metadata-Version: 2.4
Name: ai-research
Version: 0.1.9
Summary: Python SDK for the AIR Backend API
Author-email: Boris Bolliet <denario.astropilot.ai@gmail.com>, Pablo Villanueva-Domingo <denario.astropilot.ai@gmail.com>, Francisco Villaesusa-Navarro <denario.astropilot.ai@gmail.com>, Íñigo Zubeldia Lafuente <denario.astropilot.ai@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/air-ai/air-sdk
Project-URL: Repository, https://github.com/air-ai/air-sdk.git
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: python-dotenv
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.2; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Requires-Dist: mkdocs-material>=9.6.12; extra == "docs"
Requires-Dist: mkdocs-jupyter>=0.25.1; extra == "docs"
Requires-Dist: mkdocs-git-committers-plugin-2>=2.5.0; extra == "docs"
Dynamic: license-file

# AIR SDK

Python SDK for the AIR Backend API.

## Installation

Install the SDK from PyPI:

```bash
pip install air-research
```

## Quick Start

```python
import air

client = air.AIR(api_key="air_k1_...", base_url="http://localhost:8000")

# Standalone tools
keywords = client.keywords("dark matter and lensing", n=5, kw_type="aas")
enhanced = client.enhance("My research with https://arxiv.org/abs/2301.12345")

# Full research workflow
project = client.create_project("my-research", data_description="We study...")
idea = project.idea()
project.literature()
project.methods()
project.paper(journal="AAS")
review = project.review()

# File access
print(project.get_file("Iteration0/input_files/idea.md"))
print(project.list_files())
```

## Configuration

Set `AIR_API_KEY` and optionally `AIR_BASE_URL` as environment variables, or pass them directly:

```python
client = air.AIR(api_key="air_k1_...", base_url="https://api.example.com")
```

## API Reference

### `AIR` class

| Method | Description |
|--------|-------------|
| `keywords(text, n=5, kw_type="unesco")` | Extract keywords |
| `arxiv(text)` | Download arXiv papers from URLs in text |
| `enhance(text, max_workers=2, max_depth=10)` | Enhance text with arXiv context |
| `ocr(file_path)` | Process PDF with OCR (server path) |
| `create_project(name, data_description, iteration)` | Create a project |
| `get_project(name)` | Get existing project |
| `list_projects()` | List all projects |
| `delete_project(name)` | Delete a project |

### `Project` class

| Method | Description |
|--------|-------------|
| `idea(mode="fast", timeout=600)` | Generate research idea |
| `literature(timeout=600)` | Run literature search |
| `methods(mode="fast", timeout=600)` | Develop methods |
| `paper(journal="NONE", timeout=900)` | Write paper |
| `review(timeout=600)` | Run review |
| `get_file(path)` | Read a project file |
| `list_files()` | List all project files |
| `write_file(path, content)` | Write a file |
| `delete()` | Delete the project |

## Docs

Install the documentation with:

```sh
pip install air-research[docs]
```

and build it with

```sh
mkdocs serve --livereload
```

## Tests

Test with `pytest`:

```sh
pytest tests
```

You can also skip slow tests (e.g. idea generation) with

```sh
pytest tests/ -m "not slow".
```
