A Python-powered static site generator built for speed
Write static sites with Python 3.14's t-strings. Full Python ecosystem at build time. Zero runtime dependencies.
# app/pages/index.py
t"""
<html>
<head>
<title>Welcome to Hyper</title>
</head>
<body>
<h1>Hello, Hyper!</h1>
<p>Built with Python. Served as static HTML.</p>
</body>
</html>
"""Your file structure is your URL structure.
app/pages/
index.py → /
about.py → /about
blog/
index.py → /blog
[slug].py → /blog/:slug
Python 3.14's t-strings provide type-safe templates with zero learning curve.
# app/pages/team.py
members = get_team_members()
t"""
<html>
<body>
<h1>Our Team</h1>
{[t'<div>{member.name} - {member.role}</div>' for member in members]}
</body>
</html>
"""Organize content with Python dataclasses or plain dictionaries.
# app/content/__init__.py
from dataclasses import dataclass
from datetime import date
@dataclass
class Blog:
title: str
slug: str
date: date
class Meta:
path = "app/content/blog/*.md"
blogs: list[Blog]# app/pages/blog/index.py
from app.content import blogs
recent = sorted(blogs, key=lambda b: b.date, reverse=True)[:10]
t"""
<h1>Recent Posts</h1>
{[t'<a href="/blog/{post.slug}">{post.title}</a>' for post in recent]}
"""Generate pages from content automatically.
# app/pages/blog/[slug].py
from typing import Literal
from app.content import blogs
# Path parameter (injected by framework)
slug: Literal[*[b.slug for b in blogs]]
# ---
post = next(b for b in blogs if b.slug == slug)
t"""
<article>
<h1>{post.title}</h1>
<div>{post.html}</div>
</article>
"""Use any Python library at build time.
# app/pages/stats.py
from app.content import blogs
import pandas as pd
df = pd.DataFrame([{'date': b.date, 'words': len(b.content.split())} for b in blogs])
avg_words = df['words'].mean()
t"""
<h1>Blog Statistics</h1>
<p>Average: {avg_words:.0f} words per post</p>
"""Need data analysis? Image processing? API calls? Just pip install and use it.
Write content in Markdown with frontmatter and Python execution blocks.
---
title: "My Post"
date: 2025-01-15
---
# {frontmatter.title}
```python exec
recent_posts = get_recent_posts(5){[t'
### ⚡ Built for Speed
- Rust CLI for millisecond builds
- Incremental builds
- Instant hot reload
- Single binary distribution
---
## Installation
```bash
# Via uv (recommended):
uvx hyper init myblog
cd myblog
uvx hyper dev
# Or install:
uv tool install hyper
hyper build
Core Concepts (SSG + SSR)
- Routing - File-based routing, dynamic routes
- Templates - t-strings, layouts, components
- Content - Content collections, markdown, frontmatter
SSG-Specific
- Static Site Generation - Building static HTML, path generation
SSR-Specific (planned)
- Dependency Injection - Type-based injection
- Forms - Form handling
- Streaming - SSE, streaming responses
- SSR Patterns - HTMX, middleware, sessions
Planning
- Architecture - Technical decisions and implementation plan
Compared to Hugo/Zola/Jekyll:
- Full Python at build time (not template language)
- Any PyPI package available
- Python dataclasses for content
- Type-safe with IDE autocomplete
Compared to Astro:
- Simpler API - no
getStaticPaths()boilerplate - Python instead of JavaScript
- More flexible content organization
- Rust CLI for speed
Compared to Python frameworks:
- Zero runtime dependencies
- Pure static output
- No server needed
- Deploy anywhere
# app/content/__init__.py
blogs: list[dict] # That's it. No schema needed.@dataclass
class Blog:
title: str
date: date
class Meta:
path = "app/content/blog/*.md"
@property
def url(self) -> str:
return f"/blog/{self.slug}"
blogs: list[Blog] # Full validation, IDE autocomplete, type safetySSG (Static Site Generation) - Build static HTML at build time (current focus) SSR (Server-Side Rendering) - Render HTML on-demand (planned)
Both modes share the same routing, templates, and content features.
Current: Planning & design phase Next: Rust CLI implementation for SSG
See design/architecture.md for implementation roadmap.
- Documentation: design/
- GitHub: https://github.com/scriptogre/hyper
- Python 3.14 t-strings: PEP 750
MIT