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 Framework

PyPI Version Python Versions License Code Style: Black

Make Python Cute Again. > The most beautiful, agile, and visually striking web framework you'll use in your terminal.


👋 Hi, I'm Ushka!

Tired of frameworks that give you a white screen of death and boring black-and-white logs? Ushka was born from the idea that backend coding doesn't have to be ugly or bureaucratic.

I turn your filesystem into an API automatically, I configure the server myself, and if something goes wrong, I show you a Cyberpunk error page so pretty you'll want to leave the bug there.

✨ Why use me?

  • 🎨 Visual DX: My terminal logs are colorful (Neon/Dark theme), organized, and informative.
  • 📂 File-Based Routing: Stop manually importing controllers. Create a file in the routes/ folder and the magic happens.
  • 🧠 Zero Config: The first time you run me, I generate ushka.toml for you. No boilerplate.
  • 🛡️ Panic Mode: My interactive error page lets you copy the traceback with one click and inspect local variables.

✅ What's ready? (Features)

Ushka is evolving fast. Here is what is running smoothly in the current version:

  • Auto-Discovery: Automatic route mapping based on the routes/ folder.
  • Smart Response: Return dict (becomes JSON), str (becomes HTML), or pure Response objects.
  • Jinja2 Templates: Native support with a simple render() function.
  • Ushka Panic: Stylized error handling (500/404) with dark theme, interactive stacktrace, and code highlighting.
  • Auto Config: Automatic generation and reading of ushka.toml.
  • Rich Logging: Request logs colored by status code (Success=Green, Error=Red, Redirect=Blue).
  • Dependency Injection: Inject request and URL parameters (id, slug) just by declaring them in the function.
  • Core ASGI: Based on Uvicorn, fully async.

📦 Installation

pip install ushka

🚀 How to use (No fluff)

Ushka follows the "Convention over Configuration" philosophy.

1. The Structure

Create a folder. That's it. I expect something like this:

my_project/
├── app.py              # Where it all starts
├── ushka.toml          # I create this for you automatically!
├── templates/          # Your HTMLs
│   └── hello.html
└── routes/             # Your Routes (The Magic)
    ├── index.py        # Route: /
    └── users/
        └── [id].py     # Route: /users/<id>

2. Create a Route (routes/index.py)

No complex decorators on top of the function. The function name is the HTTP Method.

from ushka.template import render

# Responds to GET /
async def get():
    return render("hello.html", {"name": "Dev"})

3. Create the App (app.py)

from ushka import Ushka

app = Ushka()

if __name__ == "__main__":
    # I read the host and port from ushka.toml automatically
    app.run()

4. Run it!

python app.py

Look at your terminal. Appreciate the banner. See the route table. Now go to http://127.0.0.1:8000.


🖼️ Visual Showcase

The "Ushka Panic" (Debug Page)

We believe that making mistakes is part of the process, but debugging should be easy.

  • Inspect local variables.
  • Copy the error with one click to paste into StackOverflow/ChatGPT.
  • Dark theme so you don't burn your eyes at 3 AM.

Ushka Panic Screen


🗺️ Roadmap (What's coming next)

We are currently in Alpha, but we dream big. The plan for World Domination (v1.0):

  • Ushka CLI: ushka new commands to scaffold projects and ushka deploy for auto-HTTPS configuration (Caddy).
  • Multipart Streaming: Support for large file uploads without eating up RAM.
  • Middlewares: Robust system to intercept requests.
  • Cookies & Sessions: Native state management.
  • Subapps (Blueprints): For when your project gets huge.
  • Auth Embedded: Optional built-in login system.

🤝 Contributing

Ushka is open-source and made with love. Spotted a bug? Want to request a feature? Open an Issue!

  • License: MIT
  • Author: Kleber Code

Made with ❤️, Python, and lots of caffeine.

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.1.2.tar.gz (18.9 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.1.2-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ushka-0.1.2.tar.gz
Algorithm Hash digest
SHA256 01d7516660996af7a97dbbd55fa0ec47279b19a2ea6d5f856baf379162d23a04
MD5 9f1fdf96dd5d60f6c6b7a9c011c6b654
BLAKE2b-256 cc4aa94e01357864e344ff5b3f8ffc642a139a53ccbd2a84411f32d9a4a6b010

See more details on using hashes here.

Provenance

The following attestation bundles were made for ushka-0.1.2.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.1.2-py3-none-any.whl.

File metadata

  • Download URL: ushka-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.2 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e670d4a4c6384738b72d022c18bfe3b9152994963387081f2d0c2b1d4e39ec71
MD5 5c4b5e981325204981bc8997e8e659fa
BLAKE2b-256 8657f2fa31bb828630004384cc866b3224e4a1b83a4963d017c827fb29ccf109

See more details on using hashes here.

Provenance

The following attestation bundles were made for ushka-0.1.2-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