Metadata-Version: 2.4
Name: laminite
Version: 0.1.0
Summary: A minimal ASGI web framework with msgspec and startup-time compilation
Author: Hirokazu Miyaji
Author-email: Hirokazu Miyaji <hirokazu.miyaji@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Dist: msgspec
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/hirokazumiyaji/laminite
Project-URL: Documentation, https://github.com/hirokazumiyaji/laminite#readme
Project-URL: Repository, https://github.com/hirokazumiyaji/laminite
Project-URL: Issues, https://github.com/hirokazumiyaji/laminite/issues
Project-URL: Changelog, https://github.com/hirokazumiyaji/laminite/blob/main/CHANGELOG.md
Description-Content-Type: text/markdown

# Laminite

A minimal ASGI web framework for Python. Startup-time compilation, msgspec validation, and a thin request path.

## Requirements

- Python 3.12+

## Install

```bash
pip install laminite
```

Runtime dependency: `msgspec` only.

## Quick start

```python
import laminite
from msgspec import Struct

app = laminite.Laminite()


class Item(Struct):
    name: str
    price: float
    is_offer: bool = False


@app.get("/")
def read_root():
    return {"message": "Hello from Laminite"}


@app.get("/items/{item_id}")
async def read_item(item_id: int, q: str | None = None):
    return {"item_id": item_id, "q": q}


@app.post("/items", status_code=201)
async def create_item(body: Item):
    return {"name": body.name, "total": body.price * 1.1}
```

Run with any ASGI server, for example:

```bash
granian --interface asgi module:app
```

## Features

- Static map + segment-trie routing (404 / 405 / HEAD→GET)
- Typed path, query, and header binding via msgspec
- JSON body decode with `msgspec.Struct` or `Annotated[..., Body()]`
- Type-keyed dependency injection (app / request scope)
- Lifespan, ASGI middleware, exception handlers
- Zero-dependency `TestClient`

## Dependency policy

`[project.dependencies]` contains only `msgspec`. Dev and benchmark tools live in uv dependency groups and are not installed with the package.

## Documentation

- [Design](docs/design.md)
- [User guide](docs/guide/index.md)
- [Benchmarks](docs/benchmarks.md)

## License

MIT
