Velocix
A learning project where I rebuilt Starlette's core patterns to understand how modern async Python web frameworks work.
What This Is
- A study project built during my B.Tech CSE studies
- Heavily inspired by Starlette's architecture and patterns
- An exercise in understanding ASGI and async Python
- A way to learn performance optimization concepts
- A minimal framework experiment
What This Is NOT
- A production-ready framework
- Faster than existing solutions (FastAPI/Starlette)
- Something you should use instead of established frameworks
- A unique or groundbreaking implementation
What I Learned
- How ASGI works under the hood
- Async Python patterns and best practices
- Why performance optimization requires actual measurement, not assumptions
- How routing, middleware, and request handling work internally
- That framework overhead is usually negligible compared to database queries and business logic
- The importance of honest benchmarking and documentation
📦 Installation
Prerequisites
- Python 3.10 or higher
- pip
Install Dependencies
pip install -r requirements.txt
Core Dependencies
- orjson - Fast JSON serialization
- msgspec - Fast validation and serialization
- httptools - HTTP request parsing
- Any ASGI server (uvicorn, granian, hypercorn)
🚀 Quick Start
from velocix import Velocix
from velocix.core.response import JSONResponse
app = Velocix()
@app.get("/")
async def hello():
return {"message": "Hello World"}
@app.get("/users/{user_id}")
async def get_user(user_id: int):
return {"user_id": user_id}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
🏗️ Code Structure
velocix/
├── core/ # Core ASGI application and routing (based on Starlette patterns)
├── http/ # HTTP utilities
├── middleware/ # Middleware implementations
├── security/ # Authentication and security utilities
├── validation/ # Request validation (msgspec)
├── websocket/ # WebSocket support
├── monitoring/ # Health checks and metrics
└── testing/ # Test client utilities
📚 Documentation
- API Reference - Complete API documentation
- User Guide - How to use Velocix features
- Security Guide - Security best practices
- Internals - Architecture details
🤝 Contributing
This is a learning project, but if you find it useful or want to suggest improvements, feel free to open an issue or PR.
🙏 Acknowledgments
This project is heavily inspired by:
- Starlette - Most patterns and architecture are based on Starlette's design
- FastAPI - For the elegant decorator-based API
- msgspec - For fast validation
- orjson - For efficient JSON serialization
Special thanks to the authors of these frameworks for their excellent documentation and open-source code that made this learning project possible.
📖 Learning Resources
If you want to build something similar, I recommend:
- Reading Starlette's source code (it's very well written)
- Understanding the ASGI specification
- Studying async Python patterns
- Actually measuring performance instead of assuming optimizations work
📄 License
MIT License - See LICENSE file for details
Built as a learning exercise by a CSE student
A minimal framework experiment - use Starlette or FastAPI for real projects.
Metadata
Release files for velocix 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| velocix-0.1.3.tar.gz | 67.5 kB | Without provenance | Details for velocix-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| velocix-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for velocix-0.1.3-py3-none-any.whl |
Total release size: 145.7 kB
Release files / velocix-0.1.3.tar.gz
| Download URL | velocix-0.1.3.tar.gz |
|---|---|
| Size | 67.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
839838eea168fccc7a977d465b453007eb553be1fb774acc767eb73105d22741
|
|
BLAKE2b-256 checksum How to use checksums |
b8c2369d976e72446f55153482b26aaa49532730c1da84a64b7a9a592004d740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / velocix-0.1.3-py3-none-any.whl
| Download URL | velocix-0.1.3-py3-none-any.whl |
|---|---|
| Size | 78.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d07efa8d113db3e23321fa7984696d567af2066c150c130a1980794ea03b083
|
|
BLAKE2b-256 checksum How to use checksums |
5d7a512b8519372b96aad2c9f837dd33a8accde55f6838b1ede53ab770bb4777
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for velocix 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.