Skip to main content

Routly

Routly Logo

A lightweight, modular, modern Python microframework for Web & REST APIs.

PyPI version Documentation Status Python Versions Build Status License GitHub Stars


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 & Typed Routing: Compiled regex path matching with typed converters (/users/{id:int}, float, slug, uuid, path), multi-method routes, and modular Router(prefix=...) mounting via include_router.
  • Built-In CLI (routly): Scaffold projects (routly create), run an auto-reloading dev server (routly runserver --reload), inspect routes (routly routes), and generate secret keys (routly secretkey).
  • 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, @app.route).
  • Lifecycle & Custom Error Handling: Thread-safe @app.on_startup / @app.on_shutdown hooks and @app.error_handler(...) for status codes or exception classes.
  • 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

pip install routly

Or install with development dependencies:

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/ directory.

To run the showcase application locally:

python example/main.py

Testing

Run the comprehensive unit test suite with pytest:

pytest tests/

License

Created by Abdulbosit Alijonov.
Distributed under the MIT License.

Metadata

Release files for routly 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for routly 0.2.0
File Size Uploaded Provenance Actions
routly-0.2.0.tar.gz 42.2 kB Without provenance Details for routly-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for routly 0.2.0
File Interpreter ABI Platform Actions
routly-0.2.0-py3-none-any.whl Python 3 none any Details for routly-0.2.0-py3-none-any.whl

Total release size: 80.5 kB

Release files / routly-0.2.0.tar.gz

Download URL routly-0.2.0.tar.gz
Size 42.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e29dc1441a6e38db9b50011a810f6b18f2c4934c409aa8668e65355136df8230
BLAKE2b-256 checksum
How to use checksums
10f7ead0f143c9c659df152a5c4741f4f8d7e86b7c727929e1690c085c60f657
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / routly-0.2.0-py3-none-any.whl

Download URL routly-0.2.0-py3-none-any.whl
Size 38.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24407f7e8e7b817a1e06bd6865f7b54c0f84c87f9b090d39bb4d70a693521f88
BLAKE2b-256 checksum
How to use checksums
63bd90a0275c070988324b042e281e53b923fe8ad92c6616de667278891febf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for routly 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page