Metadata-Version: 2.4
Name: pyclay
Version: 1.0.0
Summary: Build beautiful, responsive web pages entirely in Python. No HTML, CSS, or JS required.
Project-URL: Homepage, https://github.com/ayush-sharma11/pyclay
Project-URL: Repository, https://github.com/ayush-sharma11/pyclay
Project-URL: Documentation, https://github.com/ayush-sharma11/pyclay#readme
Project-URL: Issues, https://github.com/ayush-sharma11/pyclay/issues
Project-URL: Changelog, https://github.com/ayush-sharma11/pyclay/blob/main/CHANGELOG.md
Author: Ayush Sharma
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: framework,html,python,static-site,streamlit,ui,web
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup :: HTML
Requires-Python: >=3.8
Requires-Dist: watchdog>=3.0
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

<p align="center">
  <h1 align="center">pyclay</h1>
  <p align="center"><strong>Build beautiful, responsive web pages entirely in Python.</strong></p>
  <p align="center">No HTML. No CSS. No JavaScript. Just Python.</p>
</p>

<p align="center">
  <a href="https://pypi.org/project/pyclay/"><img src="https://img.shields.io/pypi/v/pyclay?color=6366f1&style=flat-square" alt="PyPI"></a>
  <a href="https://pypi.org/project/pyclay/"><img src="https://img.shields.io/pypi/pyversions/pyclay?color=818cf8&style=flat-square" alt="Python"></a>
  <a href="LICENSE"><img src="https://img.shields.io/github/license/ayush-sharma11/pyclay?color=10b981&style=flat-square" alt="License"></a>
</p>

---

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

```bash
pip install pyclay
```

Create `app.py`:

```python
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:

```bash
pyclay run app.py
```

Build for production:

```bash
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

```python
pc.page_config(theme="obsidian")  # ivory | nebula | arctic | obsidian
```

Users can switch themes live via the built-in dropdown in the navbar.

## Layout System

```python
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](CONTRIBUTING.md) for guidelines.

## License

Apache 2.0 - see [LICENSE](LICENSE).
