Japronto Extra
A bit of sugar for the fastest python framework
pip install orjson japronto-extra
Api
@route("/")
@jsonify
def home(request):
return "You can pass an url explicitly"
@route
@jsonify
def hello_world(request):
# if you omit it though, the function name will be used
return {"I'm served at": "/hello-world"}
@route
@jsonify
def foo__bar(request):
# double underscores map onto slashes
return "I'm at /foo/bar"
@route("/validation", "POST")
@jsonify
def basic_validation(request):
# required integer query argument
id = get_argument(request.query, "id", int)
# optional `datetime` json argument with a default fallback
at = get_argument(
request.json, "at", datetime.fromisoformat, default=datetime.now()
)
return {"id": id, "at": at}
Look at the working example in expample.py
Release files for japronto-extra 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| japronto_extra-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / japronto_extra-0.1.3-py3-none-any.whl
| Download URL | japronto_extra-0.1.3-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea1faa72a6b7dfbd530f66522d3c23ab24e8ae63cbc718765f908b927fe94b5d
|
|
BLAKE2b-256 checksum How to use checksums |
9a7a8619a87291dba9e0515e50770624144ce0525e71fe4ba386034b70333b43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
|