Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

highghlow-pythonweb-1.0.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

highghlow_pythonweb-1.0.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page