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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file highghlow-pythonweb-1.0.0.tar.gz.

File metadata

  • Download URL: highghlow-pythonweb-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for highghlow-pythonweb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5352c028864440acf43cc112133039eace4e3800d3c78762edeb19c551bb1f7b
MD5 6fd92bc002d7093ef655a4f336e52699
BLAKE2b-256 d815d3160a959540358eca9d05880a0233a6bd67a57aa129e476b749f9b2ab46

See more details on using hashes here.

File details

Details for the file highghlow_pythonweb-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for highghlow_pythonweb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 244ac747bce1d12b8e110d3f980d84396586dce4fdb3b5b033a05660d7ba6517
MD5 0c474ba9001c3215aa32c1fe1829207c
BLAKE2b-256 cdb89d6eb6fa84264879a2de15d3d3766ab19fc20752c641500904e4287ba723

See more details on using hashes here.

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