Metadata-Version: 2.4
Name: inguitive
Version: 1.0.0
Summary: A pure Python web framework combining intuitive syntax with HTMX for partial page reloads and Tailwind CSS for styling
Author-email: Johannes Stork <info@stork-software.de>
License-Expression: MIT
Project-URL: Homepage, https://github.com/j-strk/inguitive
Project-URL: Documentation, https://github.com/j-strk/inguitive/blob/main/README.md
Project-URL: Repository, https://github.com/j-strk/inguitive
Project-URL: Issues, https://github.com/j-strk/inguitive/issues
Keywords: web,framework,htmx,tailwind,fastapi,python
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: FastAPI
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.95.0
Requires-Dist: uvicorn[standard]>=0.21.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: markupsafe>=2.0.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: httpx>=0.24.0; extra == "dev"
Provides-Extra: redis
Requires-Dist: redis>=4.2; extra == "redis"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5; extra == "docs"
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.24; extra == "docs"
Requires-Dist: mkdocs-autorefs>=0.5; extra == "docs"
Dynamic: license-file

<p align="center">
  <img src="src/inguitive/static/inguitive_logo_600.png" alt="inguitive" width="200">
</p>

# inguitive

A pure Python web framework combining intuitive syntax with **HTMX** for partial page reloads and **Tailwind CSS** for styling.

Components automatically re-render when state changes, eliminating the need for manual DOM manipulation or JavaScript. It is designed for Python developers who want to build interactive web applications using only Python, without sacrificing the dynamic feel of modern SPAs.

## 3 Steps to a Running App

```bash
pip install inguitive
inguitive init
inguitive run
```

`inguitive init` scaffolds a ready-to-run `app.py` in the current directory. `inguitive run` serves it at `http://localhost:8000`.

## A Simple Example

Here's what a simple app might look like — a reactive counter that updates without a full page reload:

```python
from inguitive import Div, Button, Label, State, create_app

app = create_app(title="Counter")

counter = State(0, "counter")

@app.trigger_handler
def increment():
    counter.set(counter.get() + 1)

@app.page("/")
def index():
    return Div(
        Label(text=lambda: f"Count: {counter.get()}", id="counter-label", listen_to="counter"),
        Button("+1", trigger="increment"),
    )
```

## Features

- **Reactive State Management** — `State` propagates to all listening components automatically; no manual DOM updates or JavaScript
- **Component-Based** — composable UI components with clean Python syntax; all attributes can be static strings or callables
- **Trigger Handlers** — Python functions wired directly to HTMX POST actions; pass data from components to handlers via `trigger_args` and `get_trigger_args()`
- **Form Validation** — declarative `FormSchema` with type coercion and per-constraint messages
- **URL Routing** — dynamic path parameters with type validation (`<name:type>`)
- **Session Backends** — `MemoryBackend` for development, `RedisBackend` for production, with automatic per-user state isolation
- **CLI** — `inguitive init` and `inguitive run` to scaffold and serve
- **Type Safe** — full type hints throughout the codebase
- **Tailwind CSS** — first-class support for utility-first styling

## Documentation

For the full component reference, guides, and API docs, see [docs/index.md](docs/index.md).

## License

MIT License — see [LICENSE](LICENSE) for details.

---

**Contact:** [GitHub](https://github.com/j-strk) · [Issues](https://github.com/j-strk/inguitive/issues) · info@stork-software.de
