A Flask wrapper for easy RESTful api development
Project description
PythonWEB
A Flask wrapper for easy RESTful api development
Quickstart
import pythonweb
app = pythonweb.Server()
class ExampleException(Exception):
codename = "ERR_EXAMPLE"
verbose = "This is an example exception. The specified exception params would be here: {0} and here: {1}"
code = 501
@app.api("/api/example", form=False) # form=true means that you can use this api route as a form handler
def example_endpoint(param1 : int, param2 : bool): # Type annotations are not used by the server
if param2:
raise ExampleException(param1, param2, "Param") # 501 {"error":"ERR_EXAMPLE", "message":[param1, param2, "Param"], "verbose":"This is an example..."}
return {"some_json":param1+1}
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
Close
Hashes for highghlow-pythonweb-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ceea1b40b14e6e111860a4bc14890b7f46d9690a34e49809dd4316a91d0409e |
|
MD5 | b1b95ccd6340521a4406e93232358874 |
|
BLAKE2b-256 | 650501a5de6b009d40a9dc011af4a38a0d2fa526d470aea9493021e831571252 |
Close
Hashes for highghlow_pythonweb-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72de03d5716bbbbb6bf01ed527b74006bd385ae9b8a7bd944bfefb6542599acd |
|
MD5 | 943af96cbc80bc02b91095b5653bb4a4 |
|
BLAKE2b-256 | d710462671a7110f466f8f6f4441ba4b829a7152830382f18a82bca2718f9554 |