Skip to main content

Dynamic API generator from JSON models with automatic schema inference.

Project description

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:

pip install autorestify

Or install locally for development:

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

⚡ Quick Example

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

app = FastAPI()

app.include_router(create_router())

Start the server:

uvicorn main:app --reload

📤 Uploading a collection

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

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:

pytest -v

Run with coverage reporting:

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autorestify-1.0.1.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autorestify-1.0.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file autorestify-1.0.1.tar.gz.

File metadata

  • Download URL: autorestify-1.0.1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for autorestify-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e3f85cc4cc1091fcf21189d4be44f5657603ede5270743175a1323722218da9b
MD5 3b421f805941db6008422bf4c17e7fad
BLAKE2b-256 058254374a7aa8a15593f6ba1cc9f60b41c24787497eb369e7d596cc8e7b7c21

See more details on using hashes here.

File details

Details for the file autorestify-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: autorestify-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for autorestify-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d071e13fc3858d16b31d352f992de3dbf212e1c0e2c5825d122075d3df8d3493
MD5 bbe78db1a3a8a2eefc7b9240f8967c8e
BLAKE2b-256 f69de38fd587ede0f49c6330a240cfb96729272e4dad36b7c82d97b19838ad4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page