A fast, asyncio based web-framework, that you'll enjoy using.
Project description
Tanoshi
A fast, asyncio based web-framework, that you'll enjoy using.
Read the docs.
Why Tanoshi and what is it?
Tanoshi is a fast, asyncio based web-framework, that you'll really enjoy using. Tanoshi is built to revolve around your design decisions, not ours. Tanoshi has no boiler-plate code what so ever, allowing you to have an extremely flexible code base structure. Tanoshi can also be a heavy-weight framework if you choose to opt-in to it's heavy-weight features, such as a database ORM, as well as adaptable authentication. Tanoshi allows you to quickly prototype, as well as expand and scale quickly!
It's in the name! - Tanoshi (楽しい) - Enjoyable
Key Features
- Modern
async
andawait
syntax. - Seriously impressive performance thanks to Starlette.
- Opt-in heavy-weight features such as a fully-fledged database ORM.
- Extremely flexible.
- Jinja Templating Support.
- Session and Cookie Middleware.
- Quick and easy to get started with.
Examples
from tanoshi import Tanoshi
from tanoshi.shortcuts import render, redirect
app = Tanoshi(
name="MyTanoshiApplication",
debug=True,
templates_directory="templates/"
)
@app.route("/", methods=["GET", "POST"])
async def index(request):
context = {
"message": "Hello Tanoshi!",
"moreData": ["guido", "van", "rossum"]
}
return render(request, "index.html", context)
@app.route("/redirect")
async def redirect_route(request):
return redirect("https://www.python.org/")
Running tanoshi
Running tanoshi
on a production server is super simple. Let's use the example above to learn how to run tanoshi. First, you'll need to install a production server such as uvicorn
, which is the one I personally recommend. Simply run pip instal uvicorn
to install uvicorn. Now, if you placed the example code into a file called main.py
, you'd need to run uvicorn main:app
inside the directory where your main.py
file is housed.
This process is exactly the same as other asgi frameworks, no changes there!
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
Hashes for tanoshi-0.0.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1df4090b294c630195cf6bdaf35073da970cc7c476860edab57531fa95b3d64 |
|
MD5 | c3b4ff15f6347668e27d900132161df5 |
|
BLAKE2b-256 | ae80d077774cbfa79e2f626a4b2b86b8a2cc62524b76c9747ca1697b18cc47ea |