Skip to main content

Routly

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

Built from scratch with zero bloat, native WSGI compliance, and a developer-first design.


Features

  • Fast & Expressive Routing: Dynamic path matching with typed parameter extraction (/users/{id}).
  • First-Class REST API: Automatic dict and list serialization to application/json, plus (data, status_code) return tuples.
  • Full REST Verbs: Clean method decorators (@app.get, @app.post, @app.put, @app.patch, @app.delete).
  • Batteries-Included Middleware Pipeline:
    • CsrfMiddleware (Double-submit cookie pattern)
    • CorsMiddleware (Preflight OPTIONS, customizable origins, methods, and credentials)
    • SecurityMiddleware (ALLOWED_HOSTS, clickjacking, XSS, and MIME-sniffing protection)
    • SessionMiddleware (Tamper-proof HMAC-SHA256 signed cookies)
    • GZipMiddleware (Automatic response body compression)
    • ProcessTimeMiddleware (Request execution timing in X-Process-Time)
  • HTTP Exception Hierarchy: Django-inspired exceptions (BadRequest, Unauthorized, Forbidden, NotFound, MethodNotAllowed, InternalServerError, abort(code, message)).
  • Dark-Mode Debugger: Tailwind CSS powered interactive traceback screen with request headers, client details, and traceback clipboard copy.
  • Content Negotiation: Automatic JSON error responses for API consumers, interactive debugger for browser requests.
  • Jinja2 Templating: Template inheritance with built-in {{ static('...') }} and {{ csrf_input() }} helpers.
  • Production Static Assets: Native static file delivery powered by WhiteNoise.
  • Modular Settings: Django-style configuration discovery via ROUTLY_SETTINGS_MODULE or settings.py.
  • 100% WSGI Compliant: Works seamlessly with Gunicorn, uWSGI, and any standard WSGI server.

Installation

pip install -e .

Quickstart

Create app.py:

from routly import RoutlyApp

app = RoutlyApp()


@app.get("/")
def home(request):
    return app.template("index.html")


@app.get("/api/users/{id}")
def get_user(request, id):
    return {"id": id, "name": "Abdulbosit", "active": True}


@app.post("/api/users")
def create_user(request):
    return {"status": "created", "user": request.json}, 201

Run with Gunicorn:

gunicorn -b 127.0.0.1:8000 app:app

Testing

Run the test suite with pytest:

pytest tests/

License

Author: Abdulbosit Alijonov
Open-source under the MIT License.

Metadata

Release files for routly 0.1.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.1.0
File Size Uploaded Provenance Actions
routly-0.1.0.tar.gz 25.5 kB Without provenance Details for routly-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 50.6 kB

Release files / routly-0.1.0.tar.gz

Download URL routly-0.1.0.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a4e51d4c21ad7e5d57000efabad4f66db28fdc836608c8c66d06c3915a9f6a59
BLAKE2b-256 checksum
How to use checksums
12a90ce5056f360dd9bc330d4d512c70134a21e856ce5f09078d0dbe121424e0
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.1.0-py3-none-any.whl

Download URL routly-0.1.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d0f008ac9dd336c931c93666b380d2b4b31503ff9d03cca8d5e7ae6fecd571a
BLAKE2b-256 checksum
How to use checksums
76ebe7fc8e3c22144fb6d009dd4fe59058ef1e837a361e36a15785db4773d2f4
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.1.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