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 Screenshot


🗺️ 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.5.tar.gz (18.8 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.5-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ushka-0.1.5.tar.gz
  • Upload date:
  • Size: 18.8 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.5.tar.gz
Algorithm Hash digest
SHA256 4f9f2b4649be9a41586da34c9f9b4ee168808afaa7cb02ca3cd55cd0b788c375
MD5 446169ab87759ccdbff5ce92adad7b77
BLAKE2b-256 3043f0797c0d976ae9fddbbc6e71593ece9cd05c34d54b947d915b90406cbb5d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ushka-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7541142200a66bbd6917b6fb7a9b754964a4c8e898f93a8d05de866328a5b0ea
MD5 4915c86af475e19db9e19a4581ea3e1a
BLAKE2b-256 609b40c7f06ac605404f427c9bb36b6f4aef10526aa5f1b8b610034ee01d4cae

See more details on using hashes here.

Provenance

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