A lightning-fast, opinionated web framework with a high-performance Zig substrate
Project description
Volt ⚡
A lightning-fast Python web framework with a high-performance Zig substrate.
Installation
pip install volt-framework
Vision
Volt combines the simplicity and expressiveness of Python with the raw performance of Zig. Unlike traditional Python web frameworks that rely on slow WSGI/ASGI servers, Volt includes its own blazing-fast web server written in Zig - giving you production-ready performance out of the box.
Why Volt?
- Create easy SPA-like applications - Built with HTMX in mind, you can create high quality, responsive applications, without a separate frontend
- Type-safe templating - The Jinja templating you know and love, with the power to generate type safe dataclass components for template context
- Zero external dependencies for serving - No need for gunicorn, uvicorn, or other WSGI/ASGI servers
- Batteries included - Everything you need for modern web development in one package
- Performance without complexity - Write pure Python, get Zig-level speed
- Simple developer experience - One command to run, deploy, and scale
Quick Start
import os
import time
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from volt.router import Handler, HttpRequest, HttpResponse, route, middleware, run_server
from db import query
# Easily add middleware
@middleware
def logging(request: HttpRequest, handler: Handler) -> HttpResponse:
"""Add custom logging to each request"""
start = time.time()
response = handler(request)
end = time.time() - start
print(f"Request - Path: {request.path}, Time: {end * 1_000 * 1_000 }μs")
return response
# Routes and handlers are simple to define
@route("/", method="GET")
def root(request: HttpRequest) -> HttpResponse:
context = Home.Context(
request=request,
selected=NavSelected.HOME, # HTMX Powered!
)
return HttpResponse(
Home(context).render(request),
)
if __name__ == "__main__":
run_server()
Platform Support:
- ✅ Linux (x86_64)
- ✅ macOS (x86_64, ARM64)
- ❌ Windows (not yet supported)
Why Zig?
Zig is a modern systems programming language that compiles to native machine code - the same performance class as C and Rust. While Python is interpreted at runtime, Zig code runs at native CPU speed with better safety than C and simpler syntax than Rust.
You write Python. Volt handles the performance.
Performance
Traditional Python web frameworks require external servers that add overhead and complexity:
Request → nginx → gunicorn → Django/Flask → Your Code
Volt eliminates the bottleneck:
Request → Volt (Zig) → Your Code
The result? Dramatically faster request routing, static file serving, and overall throughput - all while maintaining Python's developer-friendly syntax.
Current Status
⚠️ Alpha Release - Volt is in early development. Core routing and middleware systems are functional, but this is not yet production-ready.
Working:
- HTTP server and request routing
- Custom middleware support
- Header handling
- HTTP/1 and HTTP/1.1
- Static file serving
- Built-in templating engine
Coming Soon:
- ORM integration
- Advanced middleware (CSRF, CORS, etc.)
- Production deployment tools
Philosophy
Volt is opinionated by design. Like Django, we believe in convention over configuration, but we take it further - why should you need to choose and configure a separate web server? Why should performance require switching languages or adding complexity?
Volt gives you the full stack in one package, optimized from the ground up.
Volt is in active development. Star this repo to follow progress.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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
File details
Details for the file volt_framework-0.1.2-py3-none-any.whl.
File metadata
- Download URL: volt_framework-0.1.2-py3-none-any.whl
- Upload date:
- Size: 764.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83dcb3aaaddf6e0b05bfcda9a328bcadfd22a1416216f5bc99258cb4a3e2300b
|
|
| MD5 |
73b2644d6da3b4722330d241b343af43
|
|
| BLAKE2b-256 |
c4e26bd9de0ffba99205e39584f3778c36d8551662f1aa2b2c2aa40e027d270c
|
Provenance
The following attestation bundles were made for volt_framework-0.1.2-py3-none-any.whl:
Publisher:
pypi.yml on trkl-dev/volt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
volt_framework-0.1.2-py3-none-any.whl -
Subject digest:
83dcb3aaaddf6e0b05bfcda9a328bcadfd22a1416216f5bc99258cb4a3e2300b - Sigstore transparency entry: 628756775
- Sigstore integration time:
-
Permalink:
trkl-dev/volt@731786a59915b8a4f5bc11b6f7c2a6d2277e33d4 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/trkl-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@731786a59915b8a4f5bc11b6f7c2a6d2277e33d4 -
Trigger Event:
release
-
Statement type: