Metadata-Version: 2.4
Name: easyapix
Version: 0.1.0
Summary: Lightweight ASGI framework for building MVP backends quickly
Author: lev
License: MIT
Project-URL: Homepage, https://github.com/softpowerone/easyapix
Project-URL: Issues, https://github.com/softpowerone/easyapix/issues
Keywords: asgi,api,framework,web,backend
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
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: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2
Requires-Dist: uvicorn>=0.30
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Requires-Dist: uvicorn; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# easyapix

Lightweight ASGI framework for building MVP backends quickly.

> Status: alpha. The API may change before 1.0.
> Not to be confused with the unrelated easyapi package on PyPI, an old package created in 2014 that has not been updated since.

## Install

```bash
pip install easyapix
```

Requires Python 3.10+.

## Quick start

```python
from pydantic import BaseModel

from easyapix import Depends, EasyAPIx, HTTPException

app = EasyAPIx()


class Item(BaseModel):
    name: str
    price: float


def get_db():
    return {"connected": True}


@app.get("/")
async def index():
    return {"message": "Hello, world"}


@app.get("/users/{id}")
async def get_user(id: int, verbose: bool = False):
    if id > 100:
        raise HTTPException(404, "User not found")
    return {"id": id, "verbose": verbose}


@app.post("/items")
async def create_item(item: Item, db=Depends(get_db)):
    return {"name": item.name, "price": item.price, "db": db}
```

Run it:

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

## Features

- Routing: `get`, `post`, `put`, `patch`, `delete`
- Path and query parameters with type conversion
- Automatic JSON responses
- Pydantic request bodies with validation errors
- Dependency injection with `Depends`
- `HTTPException` and JSON error responses
- Middleware
- Sync and async handlers
- Lifespan (startup/shutdown)

## Documentation

- [Architecture](docs/architecture.md)
- [Examples](examples/)
- [Changelog](CHANGELOG.md)

## License

MIT
