Skip to main content

Ushka is a minimal, experimental Python micro-framework for hobbyists and solo developers. Its goal is to enable rapid API development with zero boilerplate by using file-based routing.

Project description

Ushka

PyPI Version Python Versions License Code Style: Black Build

Ushka is a minimal, experimental Python ASGI web framework focused on file-based routing. It turns your filesystem into your API.


⚠️ Alpha Stage

This project is in early alpha. Expect breaking changes. Not for production use.


Installation

Install via pip:

pip install ushka

Core Idea: File-Based Routing

Ushka automatically maps Python files in a routes/ directory to URL endpoints:

  • routes/index.py/
  • routes/hello.py/hello
  • routes/api/v1/status.py/api/v1/status
  • Dynamic paths: routes/users/[id].py/users/<id>
  • HTTP method = function name (get(), post(), etc.)

No decorators. No config. The filesystem is the API.


Example Project

Structure

examples/
├── app.py
└── routes/
    ├── index.py
    ├── hello.py
    └── hello/
        └── [name].py

Route Handlers

routes/index.py

def get():
    return "Welcome to the autodiscovered example!"

routes/hello.py

def get():
    return "Hello, World!"

routes/hello/[name].py

def get(name: str):
    return f"Hello, {name}!"

Application Entry Point

app.py

from ushka import Ushka

app = Ushka()

if __name__ == "__main__":
    print("Starting Ushka server on http://127.0.0.1:8000")
    app.run("127.0.0.1", 8000)

Run

python examples/app.py

Then make requests:

  • GET / → "Welcome to the autodiscovered example!"
  • GET /hello → "Hello, World!"
  • GET /hello/<name> → "Hello, !"

Manual Routing (Optional)

If you prefer explicit control:

from ushka import Ushka

app = Ushka()

def handler():
    return "Manual route"

app.router.add_route("GET", "/manual", handler)

Roadmap

  • Improve routing (static + dynamic)
  • Request/Response objects
  • Middleware support
  • CLI for scaffolding
  • Basic DI system

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ushka-0.0.5.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ushka-0.0.5-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file ushka-0.0.5.tar.gz.

File metadata

  • Download URL: ushka-0.0.5.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ushka-0.0.5.tar.gz
Algorithm Hash digest
SHA256 3dc670e3608e53abd1db47d9ae813ef6bc2f7d358ebff7230bb8434c55dc3099
MD5 656aefa7f14a6fdbdebd9b2a3a9ba378
BLAKE2b-256 f2895ab4b0448ca86642fb39f1d9e684d161b4d0d66ca47de620df16949b4d6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ushka-0.0.5.tar.gz:

Publisher: python-publish.yml on kleber-code/ushka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ushka-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: ushka-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ushka-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e7501201dac6cfc7b6a6b85265a323d027bb43b6ce4a45c58144ec38a71c4946
MD5 882c4603dd9c9e1eaa4e766dcdf8538a
BLAKE2b-256 31ba5e0d63a9f4e58e2a24411e13dea4ec40b1ef4440b4269aa4ad8f3d80ab60

See more details on using hashes here.

Provenance

The following attestation bundles were made for ushka-0.0.5-py3-none-any.whl:

Publisher: python-publish.yml on kleber-code/ushka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page