Skip to main content

A lightweight ASGI web framework for Python, inspired by Starlette

Project description

Oberoon

purpose PyPI - Version

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

pip install oberoon

Quick Start

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:

uvicorn app:app --reload

Roadmap

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

Development

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

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

oberoon-0.2.0.tar.gz (58.1 kB view details)

Uploaded Source

Built Distribution

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

oberoon-0.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file oberoon-0.2.0.tar.gz.

File metadata

  • Download URL: oberoon-0.2.0.tar.gz
  • Upload date:
  • Size: 58.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for oberoon-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6f9f83b0cd3001bcf3a2525d8b79e94183aba9ae3e158bc074064f9787d91104
MD5 c2133a92901eeb0a5b9779fd61fe94f3
BLAKE2b-256 40e7c7d4b0c73ba69e5fa1e4f8282cd39a165d055e2f7b28f6c54921a75cb547

See more details on using hashes here.

File details

Details for the file oberoon-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: oberoon-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for oberoon-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c384a43a8c1af7527159f29fce35aa2913b6f825223110fd9c78a9b681363122
MD5 0ec4273b4efddb686e96d11b711ab69a
BLAKE2b-256 8a5920280f7464087d1f0272b98c538835e8db548e33068ba1487fd99174295c

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