Metadata-Version: 2.4
Name: autorestify
Version: 1.0.1
Summary: Dynamic API generator from JSON models with automatic schema inference.
Author: Mikael Aurio Martins
License: MIT
Project-URL: Homepage, https://github.com/MikaelMartins/autorestify
Project-URL: Repository, https://github.com/MikaelMartins/autorestify
Project-URL: Issues, https://github.com/MikaelMartins/autorestify/issues
Keywords: fastapi,dynamic-api,sqlalchemy,schema,automation
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.110.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: server
Requires-Dist: uvicorn>=0.27.0; extra == "server"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: coverage>=7.0.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Requires-Dist: ruff>=0.3.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Dynamic: license-file

# AutoRESTify

Turn JSON collections into dynamic REST APIs automatically.

AutoRESTify generates fully functional REST endpoints from structured JSON documents with automatic schema inference, SQLite persistence, and a pluggable security layer.

---

## 🚀 Features

- Dynamic route generation
- Automatic schema inference
- SQLite persistence (production-ready)
- Proper in-memory test isolation
- Pluggable security architecture
- Full CRUD support
- 100% tested core
- CI with GitHub Actions

---

## 📦 Installation

Install from PyPI:

```bash
pip install autorestify
```

Or install locally for development:

```bash
git clone https://github.com/MikaelMartins/autorestify.git
cd autorestify
pip install -e .
```

---

## ⚡ Quick Example

```py
from fastapi import FastAPI
from autorestify.api.router_factory import create_router

app = FastAPI()

app.include_router(create_router())
```

Start the server:

```bash
uvicorn main:app --reload
```

---

## 📤 Uploading a collection

Send a JSON payload to the upload endpoint to register a new collection and its documents.

```http
POST /upload
Content-Type: application/json

{
  "collection": "clientes",
  "documents": [
    {"name": "Ana", "age": 30},
    {"name": "Carlos", "age": 25}
  ]
}
```

Once uploaded, the following routes are created automatically for the `clientes` collection:

```
GET    /clientes
GET    /clientes/{id}
POST   /clientes
PUT    /clientes/{id}
DELETE /clientes/{id}
```

---

## 🧠 Architecture Overview

Autorestify is built with:

- FastAPI
- SQLAlchemy
- Modular router factory
- Dynamic schema engine
- Pluggable security layer

Core modules:

```
autorestify/
  api/
  core/
  storage/
  schema/
  security/
```

---

## 🧪 Running Tests

Run the test suite:

```bash
pytest -v
```

Run with coverage reporting:

```bash
pytest --cov=autorestify --cov-report=term-missing
```

---

## 🔐 Security

Security is pluggable. Implement a custom authentication provider by extending the security interface and inject it into the router factory.

---

## 🛠 Development Setup

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
pytest -v
```

---

## 🗺 Roadmap

- Filtering support
- Pagination
- Ordering
- RBAC
- Multi-tenant architecture
- PostgreSQL support
- Async storage engine

---

## 📜 License

MIT License

---

## 👨‍💻 Author

Mikael Martins — Backend Developer | Python | FastAPI | Architecture

