Metadata-Version: 2.4
Name: oberoon
Version: 0.2.0
Summary: A lightweight ASGI web framework for Python, inspired by Starlette
Project-URL: Homepage, https://github.com/Samandar-Komilov/oberoon
Project-URL: Repository, https://github.com/Samandar-Komilov/oberoon
Project-URL: Issues, https://github.com/Samandar-Komilov/oberoon/issues
Author-email: Samandar-Komilov <voidpointer07@gmail.com>
License: MIT
License-File: LICENSE
Keywords: asgi,framework,web
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: anyio>=4.12.1
Requires-Dist: jinja2>=3.1.6
Requires-Dist: msgspec>=0.20.0
Description-Content-Type: text/markdown

# Oberoon

![purpose](https://img.shields.io/badge/purpose-learning-green)
![PyPI - Version](https://img.shields.io/pypi/v/oberoon)

A lightweight ASGI web framework for Python, inspired by Starlette. Built from scratch as a learning project to understand the internals of modern async web frameworks.

**Source code**: https://github.com/Samandar-Komilov/oberoon

## Features

- Pure ASGI interface — works with Uvicorn, Hypercorn, Daphne
- Async request handlers
- Path parameters with type conversion (`{id:int}`, `{name:str}`, `{filepath:path}`)
- Method-based routing (`@app.get`, `@app.post`, etc.)
- Attachable routers with prefix mounting (WIP)
- Structured stdout logging
- Zero magic — small codebase, easy to read and learn from

## Installation

```bash
pip install oberoon
```

## Quick Start

```python
from oberoon import Oberoon, Request, Response, setup_logging

setup_logging()

app = Oberoon()


@app.get("/hello")
async def hello(request: Request) -> Response:
    return Response(200, body=b"Hello!", content_type="text/plain")


@app.get("/users/{user_id:int}")
async def get_user(request: Request, user_id: int) -> Response:
    return Response(200, body=f"User {user_id}".encode(), content_type="text/plain")
```

Run with any ASGI server:

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

## Roadmap

- [x] ASGI core with lifespan support
- [x] Regex-based routing with path parameter converters
- [x] Structured logging
- [ ] Attachable routers (`app.include_router`)
- [ ] Middleware support
- [ ] WebSocket support
- [ ] Static files and templates

## Development

```bash
git clone https://github.com/Samandar-Komilov/oberoon.git
cd oberoon
pip install -e ".[dev]"
pytest tests/
```
