Metadata-Version: 2.4
Name: routly
Version: 0.1.2
Summary: A lightweight, modern Python microframework for Web & REST APIs
Author-email: Abdulbosit Alijonov <me@alijonov.uz>
License: MIT
Project-URL: Homepage, https://github.com/AlijonovUz/routly
Project-URL: Documentation, https://routly.readthedocs.io/
Project-URL: Repository, https://github.com/AlijonovUz/routly.git
Project-URL: Issue Tracker, https://github.com/AlijonovUz/routly/issues
Project-URL: Changelog, https://github.com/AlijonovUz/routly/releases
Keywords: routly,web,framework,microframework,api,rest,routing,wsgi,jinja2,middleware
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: WebOb>=1.8.0
Requires-Dist: parse>=1.20.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: whitenoise>=6.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: gunicorn>=21.0.0; extra == "dev"
Dynamic: license-file

# Routly

<p align="center">
  <img src="https://raw.githubusercontent.com/AlijonovUz/routly/main/example/static/images/logo.png" alt="Routly Logo" width="140" />
</p>

<p align="center">
  <strong>A lightweight, modular, modern Python microframework for Web & REST APIs.</strong>
</p>

<p align="center">
  <a href="https://pypi.org/project/routly/"><img src="https://img.shields.io/pypi/v/routly.svg?color=blue&logo=pypi&logoColor=white" alt="PyPI version"></a>
  <a href="https://routly.readthedocs.io/"><img src="https://readthedocs.org/projects/routly/badge/?version=latest" alt="Documentation Status"></a>
  <a href="https://pypi.org/project/routly/"><img src="https://img.shields.io/pypi/pyversions/routly.svg?logo=python&logoColor=white" alt="Python Versions"></a>
  <a href="https://github.com/AlijonovUz/routly/actions"><img src="https://img.shields.io/github/actions/workflow/status/AlijonovUz/routly/pypi-push.yml?branch=production&label=tests" alt="Build Status"></a>
  <a href="https://github.com/AlijonovUz/routly/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
  <a href="https://github.com/AlijonovUz/routly"><img src="https://img.shields.io/github/stars/AlijonovUz/routly?style=flat&logo=github" alt="GitHub Stars"></a>
</p>

---

## Overview

**Routly** is crafted for developers who desire the simplicity and elegance of modern microframeworks combined with enterprise-grade security and production WSGI reliability. It provides first-class REST API primitives, automatic content negotiation, double-submit CSRF defense, signed cookie sessions, and an interactive Tailwind CSS dark-mode debugger.

---

## Key Features

- **Expressive Routing:** Dynamic path matching with typed parameter extraction (`/posts/{slug}`).
- **First-Class REST APIs:** Native serialization for Python dictionaries and lists to `application/json`, plus HTTP status tuples (`{"ok": True}, 201`).
- **Standard HTTP Verbs:** Intuitive decorators (`@app.get`, `@app.post`, `@app.put`, `@app.patch`, `@app.delete`).
- **Modular Middleware Onion:**
  - `SecurityMiddleware`: Domain whitelisting (`ALLOWED_HOSTS`), clickjacking defense (`X-Frame-Options`), MIME-sniffing prevention, and HSTS.
  - `CsrfMiddleware`: Double-submit cookie defense for state-changing HTTP methods.
  - `SessionMiddleware`: Tamper-proof, HMAC-SHA256 cryptographically signed cookies.
  - `CorsMiddleware`: Cross-Origin Resource Sharing with customizable origins and preflight handling.
  - `GZipMiddleware`: On-the-fly response payload compression.
  - `ProcessTimeMiddleware`: High-precision latency diagnostics in `X-Process-Time`.
- **Intelligent Content Negotiation:** API endpoints receive clean JSON errors, while browser clients get an interactive developer error screen.
- **Tailwind Dark-Mode Debugger:** Visual traceback inspection with one-click clipboard copying and client headers display.
- **Integrated Templating:** Jinja2 rendering equipped with `{{ static(...) }}` and `{{ csrf_input() }}` helpers.
- **Built-in Static Delivery:** Seamless asset serving powered by WhiteNoise.
- **WSGI Standard:** Deploy directly on Gunicorn, uWSGI, Granian, or Waitress.

---

## Installation

```bash
pip install routly
```

Or install with development dependencies:

```bash
pip install "routly[dev]"
```

---

## Example Project

A complete, production-grade example application featuring authentication, session management, CSRF protection, and REST API CRUD is available in the [`example/`](https://github.com/AlijonovUz/routly/tree/main/example) directory.

To run the showcase application locally:

```bash
python example/main.py
```

---

## Testing

Run the comprehensive unit test suite with pytest:

```bash
pytest tests/
```

---

## License

Created by **Abdulbosit Alijonov**.  
Distributed under the MIT License.
