[!Warning] view.py is currently in alpha, and may be lacking some features. If you would like to follow development progress, be sure to join the discord.
See why I wrote it on the docs.
from view import new_app
app = new_app()
@app.get("/")
async def index():
return await app.template("index.html", engine="jinja")
app.run()
# routes/index.py
from view import get, HTML
# Build TypeScript Frontend
@get(steps=["typescript"], cache_rate=1000)
async def index():
return await HTML.from_file("dist/index.html")
from view import JSON, body, post
@post("/create")
@body("name", str)
@body("books", dict[str, str])
def create(name: str, books: dict[str, str]):
# ...
return JSON({"message": "Successfully created user!"}), 201
view.py is put through rigorous testing, checked with Valgrind, and checks for memory leaks, thanks to Memray. See the testing badges at the top.
Python 3.8+ is required.
$ pip install git+https://github.com/ZeroIntensity/view.py
$ pip install view.py
$ pipx install view.py
view.py
is distributed under the terms of the MIT license.