Skip to main content

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.

PyPI Python License


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, no webpack, no node_modules. Just pip install and 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.ico in your assets/ folder, pyclay will automatically detect and link it as your page favicon.
  • Dev Server: The dev server (pyclay run) automatically serves static files requested from your assets/ folder.
  • Static Export: The build command (pyclay build) copies the entire assets/ 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

pyclay-1.0.0.tar.gz (100.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyclay-1.0.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

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

Hashes for pyclay-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6aa31db3bde5b55eac0a63e8207f11f2284afcf2fd4c5fad5734666c59c5bb66
MD5 ed4abec1526f61c680c924a13f8750a8
BLAKE2b-256 f56d9467fe8c8e87b974983ef362628793b73ef7423768f09374207fb6845d79

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyclay-1.0.0.tar.gz:

Publisher: publish.yml on ayush-sharma11/pyclay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pyclay-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c473d4a7217b7f6efa84fbfed9d26e64a72884371e9c32ab142de607c68eac9
MD5 9adc7c024a35cee8780301c5647b339a
BLAKE2b-256 85f351fd6a81c723834884e24531f0140c21a79cd9bb4a5cbf1b47a89c6e15e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyclay-1.0.0-py3-none-any.whl:

Publisher: publish.yml on ayush-sharma11/pyclay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page