A lightweight web framework for building APIs in Python
Project description
Crimsy
A lightweight web framework for building APIs in Python, built on top of Starlette with msgspec for fast JSON encoding/decoding.
Features
- 🚀 Fast: Uses
msgspecfor ultra-fast JSON encoding/decoding - 🪶 Lightweight: Minimal dependencies (only
starletteandmsgspec) - 🔒 Fully Typed: Complete type hints for better IDE support
- 📚 Auto Documentation: Automatic OpenAPI schema generation and Swagger UI
- 🎯 Familiar API: Similar interface to FastAPI for easy adoption
- ⚡ All HTTP Methods: Support for GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
Installation
pip install crimsy # (when published)
# or for development:
uv sync
Quick Start
import msgspec
from crimsy import Crimsy, Router
class User(msgspec.Struct):
name: str
age: int = 0
app = Crimsy()
router = Router(prefix="/users")
@router.get("/")
async def list_users() -> list[User]:
return [User(name="Alice", age=30), User(name="Bob", age=25)]
@router.post("/")
async def create_user(user: User) -> User:
# Your code here
return user
app.add_router(router)
Run with:
uvicorn app:app --reload
Documentation
- OpenAPI JSON: Automatically available at
/openapi.json - Swagger UI: Automatically available at
/docs
Examples
See README_EXAMPLES.md for comprehensive examples demonstrating all features.
Development
# Install dependencies
just install
# Run tests
just test
# Run linting
just lint
License
See LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crimsy-0.0.0.tar.gz
(28.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
crimsy-0.0.0-py3-none-any.whl
(13.2 kB
view details)
File details
Details for the file crimsy-0.0.0.tar.gz.
File metadata
- Download URL: crimsy-0.0.0.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd33406ac022cdda8d79168f57196e76127b9f6ff9dd75106153f5851dab9bab
|
|
| MD5 |
bc9a1e5cac8c58524e2f00a66d5bf04f
|
|
| BLAKE2b-256 |
518c41d322dad59eeff6a1d5e2b034cd67529a9e5841105d875759614fb1e822
|
File details
Details for the file crimsy-0.0.0-py3-none-any.whl.
File metadata
- Download URL: crimsy-0.0.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
982f9f4b914028767a5cb2e451d6c7b66c5e2706f6602afb81eb34ebacf55667
|
|
| MD5 |
3cb4490f66a71ae45fb5205d56648a3c
|
|
| BLAKE2b-256 |
f508fa4c1498bcbc92ba926493d7530d369dea23b529b8e1d345a1c25aa3cc7f
|