A lightning-fast, opinionated web framework with a high-performance Zig substrate
Project description
Volt ⚡
An opinionated, lightning-fast ASGI-based Python web framework with rich and expressive Developer Experience.
Installation
pip install volt-framework
Vision
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
- Batteries included - Everything you need for modern web development in one package
- Simple developer experience - One command to run, deploy, and scale
Quick Start
import logging
from volt import Request, Response, Volt, config, http
from custom_types import NavSelected
from components import Home
log = logging.getLogger()
app = Volt()
# Easily wrap your handlers in middleware!
@app.middleware
async def logging_middleware(request, handler):
start = time.time()
response = await handler(request)
end = time.time() - start
log.info(f"Request - Path: {request.path}, Time: {end * 1_000 * 1_000}μs")
return response
# Routes and handlers are simple to define
@app.route("/", method="GET")
def root(request: HttpRequest) -> HttpResponse:
context = Home.Context(
request=request,
selected=NavSelected.HOME, # HTMX Powered!
)
return http.Response(
Home(context).render(request),
)
if __name__ == "__main__":
uvicorn.run(...)
Platform Support:
- ✅ Linux
- ✅ macOS
- ✅ Windows
Why ASGI?
WSGI servers limit your web application to one request being handled at a time, to completion. ASGI supercharges your handlers, leveraging Pythons asynchronous capabilities, enabling efficient task switching across handlers, across requests! Learn more here
Current Status
⚠️ Alpha Release - Volt is in early development. Core functionality is well underway, but Volt is not production-ready just yet. Keep an eye out for a 1.x release!
Working:
- HTTP server and request routing
- Custom middleware support
- Header handling
- Static file serving
- Built-in templating engine
- Template component generation
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 - aiming to make it as simple as possible to create a production ready SPA-like web application that is a delight to work on, and doesn't compromise.
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.2.1-py3-none-any.whl.
File metadata
- Download URL: volt_framework-0.2.1-py3-none-any.whl
- Upload date:
- Size: 23.5 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 |
819f7a51fac55c248d4283d17b9ae2d51e004b2090eab988a836735692bb9e04
|
|
| MD5 |
b94bbdbf8cb3060ea3f93ae5a5a37889
|
|
| BLAKE2b-256 |
9712aa1b08796bad25e6403fc26b12f5d7133b1e0e705b679a279416bdb8e0aa
|
Provenance
The following attestation bundles were made for volt_framework-0.2.1-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.2.1-py3-none-any.whl -
Subject digest:
819f7a51fac55c248d4283d17b9ae2d51e004b2090eab988a836735692bb9e04 - Sigstore transparency entry: 684270892
- Sigstore integration time:
-
Permalink:
trkl-dev/volt@3357d4aa0d01b046162b5145eb7d6de9b8ffa5c0 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/trkl-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@3357d4aa0d01b046162b5145eb7d6de9b8ffa5c0 -
Trigger Event:
release
-
Statement type: