Build beautiful, responsive web pages entirely in Python. No HTML, CSS, or JS required.
Project description
pyclay
Build beautiful, responsive web pages entirely in Python.
No HTML. No CSS. No JavaScript. Just Python.
pyclay is a Python-native static site builder. Write Python functions, get a production-ready HTML page - with themes, responsive layouts, and zero frontend knowledge required.
Think of it as Streamlit's simplicity, but for static sites you can deploy anywhere.
Features
- 4 Built-in Themes - Ivory, Nebula, Arctic, and Obsidian. Switch live via dropdown.
- Fully Responsive - Columns stack on mobile, navbar collapses to hamburger.
- Hot Reload - Edit Python, save, browser refreshes instantly.
- Static Export -
pyclay build app.py→ one HTML file. Deploy anywhere. - Rich Components - Cards, tables, metrics, accordions, tabs, alerts, code blocks with syntax highlighting, and more.
- Zero Config - No
package.json, nowebpack, nonode_modules. Justpip installand go.
Quick Start
pip install pyclay
Create app.py:
import pyclay as pc
pc.page_config(title="My Site", theme="obsidian")
pc.navbar("My Site", links=[
{"text": "Home", "href": "#home"},
{"text": "About", "href": "#about"},
])
pc.page("Home")
pc.heading("Hello World!")
pc.text("Built with pyclay - no HTML required.")
pc.card(title="Why pyclay?",
body="Because life is too short to write HTML.")
pc.page("About")
pc.text("This is the about page.")
Run the dev server:
pyclay run app.py
Build for production:
pyclay build app.py
# → dist/index.html (deploy to GitHub Pages, Netlify, etc.)
Components
| Component | Usage |
|---|---|
| Typography | pc.heading(), pc.text(), pc.blockquote() |
| Layout | pc.columns(), pc.column(), pc.container() |
| Data | pc.table(), pc.metric(), pc.progress_bar() |
| UI | pc.card(), pc.button(), pc.link_button(), pc.badge(), pc.alert() |
| Interactive | pc.accordion(), pc.tabs(), pc.tab_panel() |
| Media | pc.image(), pc.video(), pc.code_block(), pc.link() |
| Navigation | pc.navbar(), pc.footer(), pc.page() |
| Utility | pc.spacer(), pc.divider(), pc.html_raw() |
Static Assets & Favicon
Place all your static files (images, videos, etc.) inside an assets/ folder in your project root. You can reference them in your python code using relative paths like assets/....
- Favicon: If you put
favicon.icoin yourassets/folder,pyclaywill automatically detect and link it as your page favicon. - Dev Server: The dev server (
pyclay run) automatically serves static files requested from yourassets/folder. - Static Export: The build command (
pyclay build) copies the entireassets/folder into your output directory (dist/assets/), keeping all media links fully working when deployed.
Themes
pc.page_config(theme="obsidian") # ivory | nebula | arctic | obsidian
Users can switch themes live via the built-in dropdown in the navbar.
Layout System
with pc.columns([1, 2], gap="2rem"):
with pc.column():
pc.text("Narrow column")
with pc.column():
pc.text("Wide column")
Columns automatically stack vertically on mobile (<768px).
CLI Reference
| Command | Description |
|---|---|
pyclay run <file.py> |
Start dev server with hot reload |
pyclay run <file.py> --port 3000 |
Use a custom port |
pyclay build <file.py> |
Export static HTML to dist/ |
pyclay build <file.py> --out public |
Custom output directory |
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
Apache 2.0 - see LICENSE.
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 pyclay-1.0.0.tar.gz.
File metadata
- Download URL: pyclay-1.0.0.tar.gz
- Upload date:
- Size: 100.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aa31db3bde5b55eac0a63e8207f11f2284afcf2fd4c5fad5734666c59c5bb66
|
|
| MD5 |
ed4abec1526f61c680c924a13f8750a8
|
|
| BLAKE2b-256 |
f56d9467fe8c8e87b974983ef362628793b73ef7423768f09374207fb6845d79
|
Provenance
The following attestation bundles were made for pyclay-1.0.0.tar.gz:
Publisher:
publish.yml on ayush-sharma11/pyclay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyclay-1.0.0.tar.gz -
Subject digest:
6aa31db3bde5b55eac0a63e8207f11f2284afcf2fd4c5fad5734666c59c5bb66 - Sigstore transparency entry: 1739217886
- Sigstore integration time:
-
Permalink:
ayush-sharma11/pyclay@be27dea53060fbc706c73ec60d7bb3662db64613 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ayush-sharma11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be27dea53060fbc706c73ec60d7bb3662db64613 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyclay-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyclay-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.0 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 |
9c473d4a7217b7f6efa84fbfed9d26e64a72884371e9c32ab142de607c68eac9
|
|
| MD5 |
9adc7c024a35cee8780301c5647b339a
|
|
| BLAKE2b-256 |
85f351fd6a81c723834884e24531f0140c21a79cd9bb4a5cbf1b47a89c6e15e1
|
Provenance
The following attestation bundles were made for pyclay-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on ayush-sharma11/pyclay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyclay-1.0.0-py3-none-any.whl -
Subject digest:
9c473d4a7217b7f6efa84fbfed9d26e64a72884371e9c32ab142de607c68eac9 - Sigstore transparency entry: 1739217899
- Sigstore integration time:
-
Permalink:
ayush-sharma11/pyclay@be27dea53060fbc706c73ec60d7bb3662db64613 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ayush-sharma11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be27dea53060fbc706c73ec60d7bb3662db64613 -
Trigger Event:
release
-
Statement type: