A tiny Python-authored static site generator for terminal-inspired static web pages.
Project description
PySiteGen
Python-authored static sites.
PySiteGen is a small static site generator for people who would rather compose HTML with Python without any runtime server, client framework, or hidden build graph. PySiteGen gives you primitives. The default visual taste is just a theme layer with terminal-dark aesthetics. It is practical. You write Python functions that return HTML nodes. PySiteGen renders them to static HTML and copies the assets you explicitly ask for. It produces plain files:
public/
index.html
assets/
favicon.png
robots.txt
Works for docs sites, small product or project pages, personal sites, link hubs, simple SPA-style hash routes, and static pages that benefit from Python data and composition.
Install
python -m pip install pysitegen
pysitegen --version
Start A Site
pysitegen init my-site
cd my-site
pysitegen serve
serve builds once, watches your site files, rebuilds when they change, and reloads the browser tab automatically.
A Page
from pysitegen import a, default_dark, h1, p, page, section
def build():
return page(
section(
p("PySiteGen", class_="eyebrow"),
h1("Hello from Python."),
p("This is a static page generated from Python primitives.", class_="muted"),
a("Read more", href="#more", class_="button primary"),
class_="container stack",
),
title="Hello",
description="A PySiteGen page.",
theme=default_dark(),
)
Build it and serve it:
pysitegen build
pysitegen serve --host 127.0.0.1 --port 8000
Use pysitegen serve --no-reload when you want the plain static server.
This Repo
This repository contains the package source, tests, and the real PySiteGen website:
src/pysitegen/ package source and bundled framework assets
tests/ fixture-based behavior tests
website/ PySiteGen website source
Develop locally:
python -m pip install -e .[dev]
python -m pytest
Build and serve the website:
cd website
pysitegen build
pysitegen serve --host 127.0.0.1 --port 8000
Do not edit website/public/ as source.
Current Limits
PySiteGen is small on purpose.
- The Markdown parser is intentionally limited.
- There is no template/layout system yet.
- There is no plugin system.
- The default theme is useful, not universal.
- The API is still young.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 pysitegen-1.0.0.tar.gz.
File metadata
- Download URL: pysitegen-1.0.0.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
509151eee7091dc2a4a102db516e58898ac2f1de6f97cac1b7b342c7a0c8c2f5
|
|
| MD5 |
7d313df49f72d22c64652c6eb56bb44e
|
|
| BLAKE2b-256 |
50117033ebe4c1361301973b2075a304284f4dda1038249e4952ef7ab590f43b
|
Provenance
The following attestation bundles were made for pysitegen-1.0.0.tar.gz:
Publisher:
publish.yml on ujjwalvivek/pysitegen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysitegen-1.0.0.tar.gz -
Subject digest:
509151eee7091dc2a4a102db516e58898ac2f1de6f97cac1b7b342c7a0c8c2f5 - Sigstore transparency entry: 1572209852
- Sigstore integration time:
-
Permalink:
ujjwalvivek/pysitegen@62280916b93cc2441c86565ca7b636446934ff61 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ujjwalvivek
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@62280916b93cc2441c86565ca7b636446934ff61 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pysitegen-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pysitegen-1.0.0-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0cebc3e5b4c7ae05f08112588c9ecad2ceff1fc831f6fdfbdf4bb9009f4a7f8
|
|
| MD5 |
705c8b628fc878614c3d2f98a3b8efc0
|
|
| BLAKE2b-256 |
74e521f2fb40c81d9c0022e96f6f46c26ca03a0b769a49df672cab63974b8e7a
|
Provenance
The following attestation bundles were made for pysitegen-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on ujjwalvivek/pysitegen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysitegen-1.0.0-py3-none-any.whl -
Subject digest:
d0cebc3e5b4c7ae05f08112588c9ecad2ceff1fc831f6fdfbdf4bb9009f4a7f8 - Sigstore transparency entry: 1572209868
- Sigstore integration time:
-
Permalink:
ujjwalvivek/pysitegen@62280916b93cc2441c86565ca7b636446934ff61 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ujjwalvivek
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@62280916b93cc2441c86565ca7b636446934ff61 -
Trigger Event:
push
-
Statement type: