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
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. - ✍️ Decorator Routing: For those who prefer explicitness, declare routes with decorators, just like in Flask or FastAPI.
- 🧠 Zero Config: The first time you run me, I generate
ushka.tomlfor 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:
- ✅ Dual Routing System:
- Auto-Discovery: Automatic route mapping based on the
routes/folder. - Decorator-Based: Explicitly define routes with
@app.get(),@app.post(), etc.
- Auto-Discovery: Automatic route mapping based on the
- ✅ Smart
RequestObject: Accessheaders,query,body,json, andformdata as properties. Data is loaded lazily on first access. - ✅ Flexible
Response: Return adict(for JSON),str(for HTML), or a completeResponseobject for full control. - ✅ 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: Automatically inject the
Requestobject and dynamic URL parameters into your route functions just by type-hinting them. - ✅ Core ASGI: Based on Uvicorn, fully async.
📦 Installation
pip install ushka
🚀 How to use (No fluff)
Ushka offers two ways to build your API. Choose one or mix them!
Method 1: File-Based Routing (The Classic)
This method follows the "Convention over Configuration" philosophy.
1. The Structure:
my_project/
├── app.py # Where it all starts
├── ushka.toml # I create this for you automatically!
└── routes/ # Your Routes (The Magic)
├── index.py # Route: /
└── users/
└── [id].py # Route: /users/<id>
2. The Route (routes/index.py):
The function name becomes the HTTP Method.
# Responds to GET /
def get():
return "<h1>Hello, World!</h1>"
3. The App (app.py):
from ushka import Ushka
app = Ushka()
if __name__ == "__main__":
# Host and port are loaded from ushka.toml
app.run()
Method 2: Decorator-Based Routing (The Explicit)
Prefer to see your routes in one place? Use decorators.
1. The App (app.py):
from ushka import Ushka, Request
app = Ushka()
# Responds to GET /
@app.get("/")
def index():
return "<h1>Hello from a decorator!</h1>"
# Responds to POST /users
@app.post("/users")
async def create_user(request: Request):
user_data = await request.json()
return {"status": "created", "user": user_data}
if __name__ == "__main__":
app.run()
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.
🗺️ Roadmap (What's coming next)
We are currently in Alpha, but we dream big. The plan for World Domination (v1.0):
- Ushka CLI:
ushka newcommands to scaffold projects andushka deployfor 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ushka-0.2.0.tar.gz.
File metadata
- Download URL: ushka-0.2.0.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
363d0177114ff79d10be87cb2457199f4aa3db395e9a13f893de78682a61d520
|
|
| MD5 |
9c8e7456ac7452759b29d3bf9c6c03ec
|
|
| BLAKE2b-256 |
1edc568ef172e38a8f842985552a5b1f883116554fd044127df34b3f8002cfb0
|
Provenance
The following attestation bundles were made for ushka-0.2.0.tar.gz:
Publisher:
python-publish.yml on kleber-code/ushka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ushka-0.2.0.tar.gz -
Subject digest:
363d0177114ff79d10be87cb2457199f4aa3db395e9a13f893de78682a61d520 - Sigstore transparency entry: 732058802
- Sigstore integration time:
-
Permalink:
kleber-code/ushka@4c5c89806e09b6afb7ea39c121a7b90351d0baf3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kleber-code
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4c5c89806e09b6afb7ea39c121a7b90351d0baf3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ushka-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ushka-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6b231049c78420c06fc7492330fc3c6048896738d51b2a07723a70160a383cf
|
|
| MD5 |
52c1adc6ee95463547cc5818e1360ccb
|
|
| BLAKE2b-256 |
8e8411ba69499cbfae014a4602e0f0cbb1835ff47df6e9203cb9575ed0054550
|
Provenance
The following attestation bundles were made for ushka-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on kleber-code/ushka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ushka-0.2.0-py3-none-any.whl -
Subject digest:
c6b231049c78420c06fc7492330fc3c6048896738d51b2a07723a70160a383cf - Sigstore transparency entry: 732058803
- Sigstore integration time:
-
Permalink:
kleber-code/ushka@4c5c89806e09b6afb7ea39c121a7b90351d0baf3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/kleber-code
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4c5c89806e09b6afb7ea39c121a7b90351d0baf3 -
Trigger Event:
push
-
Statement type: