Nitro CLI
Build static sites with Python code instead of template engines. Live reload, incremental builds, deploy anywhere.
$ pip install nitro-cliFeatures
Python-powered pages
Write pages as Python functions using nitro-ui. No template language to learn.
Live reload
Development server with automatic browser refresh on every file change.
Incremental builds
Only rebuilds changed pages. Full builds stay fast as your site grows.
Dynamic routes
Generate pages from data with [slug].py pattern. Perfect for blogs and catalogues.
Image optimisation
Responsive images with WebP and AVIF conversion at build time.
Islands architecture
Partial hydration for interactive components without shipping JS for the entire page.
Plugin system
Hook into the build lifecycle with nitro-dispatch. Extend anything.
One-click deploy
Deploy to Netlify, Vercel, or Cloudflare Pages with a single command.
Draft pages
Mark pages as drafts to preview during development but exclude from production.
Quick example
from nitro_ui import HTML, Head, Body, Title, Meta, H1, Paragraph
from nitro import Page
def render():
content = HTML(
Head(
Meta(charset="UTF-8"),
Title("My Page"),
),
Body(
H1("Hello, World!"),
Paragraph("Built with Nitro."),
),
)
return Page(title="My Page", content=content)Recipes
Run an HTTP server in Python
Serve a folder over HTTP with one command, and know where that command stops being enough.
Read ->Choosing a web server for Python
The built-in server, WSGI, ASGI and the case where you do not need a server at all.
Read ->Python web frameworks compared
Django, Flask and FastAPI side by side, the smaller options worth knowing, and the case where you can skip the server.
Read ->