Metadata-Version: 2.4
Name: craft-easy-api
Version: 0.1.0
Summary: Craft your API the easy way — Production-ready REST API framework built on FastAPI + MongoDB
Project-URL: Homepage, https://craft-easy.dev
Project-URL: Repository, https://github.com/easy-software-system/craft-easy-api
Project-URL: Issues, https://github.com/easy-software-system/craft-easy-api/issues
Project-URL: Documentation, https://craft-easy.dev/docs
Author-email: Easy Software System <dev@craft-easy.dev>
License-Expression: MIT
License-File: LICENSE
Keywords: api,beanie,crud,fastapi,framework,mongodb,pydantic,rest
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: authlib>=1.4
Requires-Dist: beanie>=1.27
Requires-Dist: cryptography>=44.0
Requires-Dist: fastapi>=0.115
Requires-Dist: motor>=3.6
Requires-Dist: passlib[bcrypt]>=1.7
Requires-Dist: pydantic-settings>=2.7
Requires-Dist: pydantic>=2.10
Requires-Dist: pyjwt[crypto]>=2.10
Requires-Dist: slowapi>=0.1.9
Requires-Dist: structlog>=24.0
Requires-Dist: uvicorn>=0.34
Provides-Extra: dev
Requires-Dist: coverage>=7.0; extra == 'dev'
Requires-Dist: faker>=33.0; extra == 'dev'
Requires-Dist: freezegun>=1.4; extra == 'dev'
Requires-Dist: httpx>=0.28; extra == 'dev'
Requires-Dist: mongomock-motor>=0.0.34; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# Craft Easy API

**Craft your API the easy way.**

A production-ready base system for REST APIs built on FastAPI + MongoDB. Get authentication, authorization, CRUD, cascade operations, and audit logging out of the box — then focus on your business logic.

> **Status:** Pre-alpha. API is unstable and will change.

## What you get

- **Zero-boilerplate CRUD** — Define a model, get a complete REST endpoint with validation, pagination, filtering, and sorting
- **Authentication** — JWT (ES512) with toggleable on/off, OAuth2 providers (Google, Microsoft, GitHub)
- **Feature-based authorization** — Access groups with resource/attribute/data-level permissions
- **Cascade operations** — Declarative delete (deny/null/delete) and update (subscriber pattern)
- **ETag concurrency control** — Optimistic locking on all mutations
- **Audit trail** — Every mutation logged automatically
- **Schema-driven admin** — `/admin/schema` endpoint powers the [Craft Easy Admin](https://github.com/easy-software-system/craft-easy-admin) app

## Quick start

```bash
pip install craft-easy-api
```

```python
from craft_easy import create_app
from craft_easy.crud import Resource
from craft_easy.models.user import User
from craft_easy.models.organization import Organization

app = create_app()

app.include_router(Resource(User, "users").build())
app.include_router(Resource(Organization, "organizations").build())
```

```bash
uvicorn app:app --reload
# API:     http://localhost:8000
# Docs:    http://localhost:8000/docs
```

## Development

```bash
git clone https://github.com/easy-software-system/craft-easy-api.git
cd craft-easy-api
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
docker compose up -d    # Start MongoDB
pytest                  # Run tests
```

## Documentation

Full documentation: [craft-easy.dev](https://craft-easy.dev) *(coming soon)*

## License

MIT — see [LICENSE](LICENSE).
