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-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5352c028864440acf43cc112133039eace4e3800d3c78762edeb19c551bb1f7b |
|
MD5 | 6fd92bc002d7093ef655a4f336e52699 |
|
BLAKE2b-256 | d815d3160a959540358eca9d05880a0233a6bd67a57aa129e476b749f9b2ab46 |
Close
Hashes for highghlow_pythonweb-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 244ac747bce1d12b8e110d3f980d84396586dce4fdb3b5b033a05660d7ba6517 |
|
MD5 | 0c474ba9001c3215aa32c1fe1829207c |
|
BLAKE2b-256 | cdb89d6eb6fa84264879a2de15d3d3766ab19fc20752c641500904e4287ba723 |