volt-framework


Namevolt-framework JSON
Version 0.1.8 PyPI version JSON
download
home_pageNone
SummaryA lightning-fast, opinionated web framework with a high-performance Zig substrate
upload_time2025-10-26 22:29:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords web framework http async performance zig
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Volt ⚡

A lightning-fast Python web framework with a high-performance Zig substrate.

## Installation
```bash
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

```python
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 (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.*

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "volt-framework",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "web, framework, http, async, performance, zig",
    "author": null,
    "author_email": "Nick Henderson <nick@trkl.dev>",
    "download_url": null,
    "platform": null,
    "description": "# Volt \u26a1\n\nA lightning-fast Python web framework with a high-performance Zig substrate.\n\n## Installation\n```bash\npip install volt-framework\n```\n\n## Vision\n\nVolt 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.\n\n**Why Volt?**\n- **Create easy SPA-like applications** - Built with HTMX in mind, you can create high quality, responsive applications, without a separate frontend\n- **Type-safe templating** - The Jinja templating you know and love, with the power to generate type safe dataclass components for template context\n- **Zero external dependencies for serving** - No need for gunicorn, uvicorn, or other WSGI/ASGI servers\n- **Batteries included** - Everything you need for modern web development in one package\n- **Performance without complexity** - Write pure Python, get Zig-level speed\n- **Simple developer experience** - One command to run, deploy, and scale\n\n## Quick Start\n\n```python\nimport os\nimport time\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import Session\n\nfrom volt.router import Handler, HttpRequest, HttpResponse, route, middleware, run_server\nfrom db import query\n\n# Easily add middleware\n@middleware\ndef logging(request: HttpRequest, handler: Handler) -> HttpResponse:\n    \"\"\"Add custom logging to each request\"\"\"\n    start = time.time()\n    response = handler(request)\n    end = time.time() - start\n    print(f\"Request - Path: {request.path}, Time: {end * 1_000 * 1_000 }\u03bcs\")\n    return response\n\n# Routes and handlers are simple to define\n@route(\"/\", method=\"GET\")\ndef root(request: HttpRequest) -> HttpResponse:\n    context = Home.Context(\n        request=request,\n        selected=NavSelected.HOME,  # HTMX Powered!\n    )\n    return HttpResponse(\n        Home(context).render(request),\n    )\n\n\nif __name__ == \"__main__\":\n    run_server()\n```\n\n## Platform Support:\n- \u2705 Linux (x86_64)\n- \u2705 macOS (ARM64)\n- \u274c Windows (not yet supported)\n\n## Why Zig?\n\nZig 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.\n\nYou write Python. Volt handles the performance.\n\n## Performance\n\nTraditional Python web frameworks require external servers that add overhead and complexity:\n```\nRequest \u2192 nginx \u2192 gunicorn \u2192 Django/Flask \u2192 Your Code\n```\n\nVolt eliminates the bottleneck:\n```\nRequest \u2192 Volt (Zig) \u2192 Your Code\n```\n\nThe result? Dramatically faster request routing, static file serving, and overall throughput - all while maintaining Python's developer-friendly syntax.\n\n## Current Status\n\n\u26a0\ufe0f **Alpha Release** - Volt is in early development. Core routing and middleware systems are functional, but this is not yet production-ready.\n\n**Working:**\n- HTTP server and request routing\n- Custom middleware support\n- Header handling\n- HTTP/1 and HTTP/1.1\n- Static file serving\n- Built-in templating engine\n\n**Coming Soon:**\n- ORM integration\n- Advanced middleware (CSRF, CORS, etc.)\n- Production deployment tools\n\n## Philosophy\n\nVolt 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?\n\nVolt gives you the full stack in one package, optimized from the ground up.\n\n---\n\n*Volt is in active development. Star this repo to follow progress.*\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A lightning-fast, opinionated web framework with a high-performance Zig substrate",
    "version": "0.1.8",
    "project_urls": {
        "Homepage": "https://volt.trkl.dev",
        "Issues": "https://github.com/trkl-dev/volt/issues",
        "Source": "https://github.com/trkl-dev/volt"
    },
    "split_keywords": [
        "web",
        " framework",
        " http",
        " async",
        " performance",
        " zig"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9f6a87b5942f0494975ed742497ff99b1a26de82156d2d61f3a1fc4ecda4d85a",
                "md5": "386633d397157364d49f142fadd3bc88",
                "sha256": "8fad1ad75a5bbb3185f637a40adf2216b1afad14b0a518d67901137befcc4530"
            },
            "downloads": -1,
            "filename": "volt_framework-0.1.8-cp313-cp313-macosx_15_0_universal2.whl",
            "has_sig": false,
            "md5_digest": "386633d397157364d49f142fadd3bc88",
            "packagetype": "bdist_wheel",
            "python_version": "cp313",
            "requires_python": ">=3.12",
            "size": 158684,
            "upload_time": "2025-10-26T22:29:23",
            "upload_time_iso_8601": "2025-10-26T22:29:23.959215Z",
            "url": "https://files.pythonhosted.org/packages/9f/6a/87b5942f0494975ed742497ff99b1a26de82156d2d61f3a1fc4ecda4d85a/volt_framework-0.1.8-cp313-cp313-macosx_15_0_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4e29dd512a553915ba9c87b9052775675cc2a3dd687ea39b6c03ba4162117803",
                "md5": "9a2a8a5d127c029280aa9b8a7bb8b4cc",
                "sha256": "4f8bb5f5aa3ed143fe88f341baefa7c213a094cd4d92dcd74d7d5d6ce388fe41"
            },
            "downloads": -1,
            "filename": "volt_framework-0.1.8-cp313-cp313-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "9a2a8a5d127c029280aa9b8a7bb8b4cc",
            "packagetype": "bdist_wheel",
            "python_version": "cp313",
            "requires_python": ">=3.12",
            "size": 791663,
            "upload_time": "2025-10-26T22:29:25",
            "upload_time_iso_8601": "2025-10-26T22:29:25.607661Z",
            "url": "https://files.pythonhosted.org/packages/4e/29/dd512a553915ba9c87b9052775675cc2a3dd687ea39b6c03ba4162117803/volt_framework-0.1.8-cp313-cp313-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-26 22:29:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "trkl-dev",
    "github_project": "volt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "volt-framework"
}
        
Elapsed time: 1.16534s