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! ๐
โจ MINIMALIST ABOVE EVERYONE, CUTE ABOVE EVERYTHING. โจ The most adorable, agile, and visually captivating web framework for your Python adventures!
๐พ Hello, Lovely Coder! I'm Ushka!
Are you tired of web frameworks that feel... well, a bit boring? ๐ด Black-and-white logs, endless configurations, and error pages that make you want to curl up and cry? ๐ญ
๐ Ushka believes backend coding should be a joyous, beautiful experience! I transform the mundane into the magical, turning complex tasks into simple, delightful moments.
๐ Why choose little old me? (Ushka's Sweet Perks!)
- ๐จ Visual Delight: My terminal logs are a pastel dream! Minimalist, organized, and bursting with helpful colors.
- ๐ File-Based Routing: Pure Magic! โจ
Forget wrestling with imports. Just create a file in your
routes/folder, and poof! Your API endpoint is ready to charm. - โ๏ธ Decorator Routing: Elegantly Expressive! For those who love a clear declaration, define your routes with cute little decorators, just like hugging your code!
- ๐ง Zero Config: Instant Cuddles!
Run me for the first time, and I'll lovingly craft an
ushka.tomljust for you. No fuss, just fun! - ๐ก๏ธ Ushka Panic: The Cutest Errors! Oopsie! A bug? My interactive error page is so darling, you might just fall in love with debugging! Copy tracebacks, inspect variables โ all with a friendly smile.
๐ Peek at the Docs!
This README is just a tiny hug! For a deeper dive into Ushka's heart, including tutorials, guides, and a full API reference, flutter over to our full documentation here.
โ What Ushka does best! (Tiny but Mighty Features!)
Ushka is always growing with love! Here's what's purring smoothly in the current version:
- โ
Dual Routing System: Double the Cuteness!
- Auto-Discovery: Automatic route mapping just by creating files in
routes/. - Decorator-Based: Explicitly define routes with
@app.get(),@app.post(), etc.
- Auto-Discovery: Automatic route mapping just by creating files in
- โ
Smart
RequestObject: Clever & Cozy! Accessheaders,query,body,json, andformdata effortlessly. Data loads lazily, just when you need a little peek! - โ
Flexible
Response: Your Way, Always! Return adict(for yummy JSON), astr(for snuggly HTML), or a fullResponseobject for ultimate control! - โ
Jinja2 Templates: Warm & Fuzzy!
Native support with a simple
render()function to make your pages sparkle. - โ Ushka Panic: Debugging is a Breeze! Stylized error handling (500/404) with a cozy dark theme, interactive stacktrace, and super clear code highlighting.
- โ
Auto Config: Set & Forget!
Automatic generation and gentle reading of
ushka.toml. - โ Rich Logging: A Symphony of Colors! Request logs adorned with colors for every status code (Success=Green, Error=Red, Redirect=Blue).
- โ
Dependency Injection: Smart Helpers!
Automatically inject the
Requestobject and dynamic URL parameters into your route functions with just a type-hint. So clever! - โ Core ASGI: Speedy & Sweet! Built on Uvicorn, fully asynchronous for a zippy, happy experience.
๐ฆ Install Ushka (It's a Cinch!)
Getting started is as easy as a gentle purr!
pip install ushka
๐ How to Play with Ushka! (Super Simple Steps!)
Ushka offers two delightful ways to build your API. Pick your favorite or mix them up!
Method 1: File-Based Routing (The Classic Cuddle!)
This method embraces "Convention over Configuration" with a warm hug!
1. Your Project's Cozy Nook:
my_project/
โโโ app.py # Where all the magic begins!
โโโ ushka.toml # Ushka lovingly creates this for you!
โโโ routes/ # Your delightful Routes (Pure enchantment!)
โโโ index.py # Route: /
โโโ users/
โโโ [id].py # Route: /users/<id>
2. Your First Charming Route (routes/index.py):
The function name sweetly becomes your HTTP Method!
# Responds to GET / with a little wave!
def get():
return "<h1>Hello, World from Ushka! ๐</h1>"
3. Your Little App (app.py):
from ushka import Ushka
app = Ushka()
if __name__ == "__main__":
# Host and port are loaded from your cozy ushka.toml
app.run()
Method 2: Decorator-Based Routing (The Explicit Embrace!)
Prefer to see all your routes in one happy place? Decorators are your best friend!
1. Your Little App (app.py):
from ushka import Ushka, Request
app = Ushka()
# Responds to GET / with a cheerful greeting!
@app.get("/")
def index():
return "<h1>Hello from a decorator, with love!</h1>"
# Responds to POST /users with a warm welcome!
@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! (So exciting!)
python app.py
Peep at your terminal! Admire the adorable banner. See your neat route table.
Now, dash over to http://127.0.0.1:8000 and feel the cuteness!
๐ผ๏ธ A Glimpse of Cuteness! (Visual Showcase)
The "Ushka Panic" (Your Debugging Buddy!)
We know little accidents happen, but debugging shouldn't be a scary monster! Ushka Panic is here to help with a smile.
- ๐ Inspect local variables: Peek at what's happening behind the scenes!
- ๐ Copy the error: One tiny click to share with your friends (or StackOverflow/ChatGPT)!
- ๐ Dark theme: So your eyes stay cozy even during late-night coding cuddles!
๐ค Join Our Cozy Community!
Ushka is made with so much โค๏ธ. Spotted a teeny bug? Have a sweet feature idea? Please, open an Issue!
- License: MIT
- Author: Kleber Code (kleber-code)
Made with an abundance of โค๏ธ, Python magic, and endless purrs.
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.3.0.tar.gz.
File metadata
- Download URL: ushka-0.3.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e1c973ed0e00c4d124f90771792b2e117a5709c0aeae2ea5e5ad66cbf1b627a
|
|
| MD5 |
cc2fc4ff86c08a66ddf09885826b8854
|
|
| BLAKE2b-256 |
55deed0ed5086689addc508705b408350234ff9006aad3930ac86de9e7640f03
|
Provenance
The following attestation bundles were made for ushka-0.3.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.3.0.tar.gz -
Subject digest:
5e1c973ed0e00c4d124f90771792b2e117a5709c0aeae2ea5e5ad66cbf1b627a - Sigstore transparency entry: 732973678
- Sigstore integration time:
-
Permalink:
kleber-code/ushka@5b8c0d30ac128fa7573c494c2b3769fbedffd4fc -
Branch / Tag:
refs/tags/v0.3.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@5b8c0d30ac128fa7573c494c2b3769fbedffd4fc -
Trigger Event:
push
-
Statement type:
File details
Details for the file ushka-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ushka-0.3.0-py3-none-any.whl
- Upload date:
- Size: 25.1 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 |
ded49e857bd6256c959f9325e409e78b9cff25fbe1045b3c27566faf3b86b8cd
|
|
| MD5 |
3083294fe15dd9acfa7c02386eee6c00
|
|
| BLAKE2b-256 |
515cb61518d16f9d5959bb0053b713b7c2c42e495b4d0eb15efa4399988bfe68
|
Provenance
The following attestation bundles were made for ushka-0.3.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.3.0-py3-none-any.whl -
Subject digest:
ded49e857bd6256c959f9325e409e78b9cff25fbe1045b3c27566faf3b86b8cd - Sigstore transparency entry: 732973698
- Sigstore integration time:
-
Permalink:
kleber-code/ushka@5b8c0d30ac128fa7573c494c2b3769fbedffd4fc -
Branch / Tag:
refs/tags/v0.3.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@5b8c0d30ac128fa7573c494c2b3769fbedffd4fc -
Trigger Event:
push
-
Statement type: