Metadata-Version: 2.4
Name: dinorex-py
Version: 0.1.4
Summary: AI-powered API documentation for Python projects — one command, full docs.
Project-URL: Homepage, https://github.com/Di-nobi/dinorex-py
Project-URL: Repository, https://github.com/Di-nobi/dinorex-py
Project-URL: Issues, https://github.com/Di-nobi/dinorex-py/issues
Author: Dinorex
License: MIT
Keywords: ai,api,cli,django,documentation,fastapi,flask,openapi
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: Flask
Classifier: Intended Audience :: Developers
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
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: anthropic>=0.20.0
Requires-Dist: click>=8.1.0
Requires-Dist: flask-cors>=4.0.0
Requires-Dist: flask>=3.0.0
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Description-Content-Type: text/markdown

# dinorex-py

> AI-powered API documentation for Python projects — one command, full docs.

The Python sibling of [dinorex](https://github.com/your-org/dinorex).  
Point it at any Python backend and get a live interactive docs UI instantly.

## Supported frameworks

| Framework | Route detection | Model/schema detection |
|-----------|----------------|----------------------|
| **FastAPI** | `@router.get`, `@app.get`, `APIRouter` | Pydantic v1 & v2 `BaseModel` |
| **Flask** | `@app.route`, `@bp.route`, `MethodView` | Marshmallow schemas |
| **Django** | `urls.py` `path()` / `re_path()`, CBVs | Django ORM `models.Model` |
| **DRF** | `ViewSet`, `APIView`, `@action` | `ModelSerializer`, `Serializer` |
| **Falcon** | `on_get`, `on_post` … responders | — |
| **Sanic** | `@app.route`, `@bp.route` | — |
| **Litestar** | `@get`, `@post`, `Controller` | Pydantic / attrs |
| **Starlette** | `Route()`, `Mount()` | Pydantic |
| **Tornado** | `RequestHandler` subclasses | — |
| **aiohttp** | `RouteTableDef`, `add_route` | — |
| **SQLAlchemy** | — | `Column`, `mapped_column` |
| **Tortoise ORM** | — | `fields.CharField` … |

## Installation

```bash
pip install dinorex-py
```

## Quick start

```bash
# Anthropic (default)
export ANTHROPIC_API_KEY=sk-ant-...
dinorex scan /path/to/your/project

# Groq (free)
export GROQ_API_KEY=gsk_...
dinorex scan /path/to/your/project --provider groq

# Custom port
dinorex scan . -p 8080
```

## Project structure

```
dinorex-py/
├── src/
│   └── dinorex_py/
│       ├── __init__.py
│       ├── cli.py          # Click CLI entry point
│       ├── scanner.py      # File discovery for all Python frameworks
│       ├── agent.py        # Anthropic Claude agent
│       ├── agent_groq.py   # Groq/Llama3 agent (free tier)
│       ├── server.py       # Flask server + REST API
│       ├── store.py        # Persistent spec cache + diff logic
│       └── public/         # Frontend UI (shared with dinorex Node)
├── pyproject.toml
└── README.md
```

## How it works

1. **Scan** — discovers route files, controllers, services, and models using glob patterns tuned for every Python framework.
2. **Analyse** — sends the source code to Claude (or Llama3 via Groq) which extracts a structured JSON spec.
3. **Cache** — saves the spec and file hashes to `.dinorex/spec.json`. Re-runs are incremental — only changed files are re-analysed.
4. **Serve** — starts a local Flask server with the interactive UI.

## Environment variables

| Variable | Description |
|----------|-------------|
| `ANTHROPIC_API_KEY` | Required for Anthropic provider |
| `GROQ_API_KEY` | Required for Groq provider |
| `DINOREX_PROVIDER` | Set default provider (`anthropic` or `groq`) |

## License

MIT