Skip to main content

Little API the web framework that could

Project description

Little-API: The little web framework that could

PyPI

It's a WSGI framework and can be used with any WSGI application server such as Gunicorn.

Installation

pip install little-api

Usage

from little_api.api import API

app = API()

# Json Response Example
@app.route("/home")
def home(request, response):
    response.json = {"name": "little-api"}

# Class Base Route Example
@app.route("/book")
class BookResource:
    def get(self, req: Request, resp: Response):
        resp.text = "Get Books Page"

    def post(self, req: Request, resp: Response):
        resp.text = "Create Books Page"


# Rendering Template Example
@app.route("/template")
def template_render(req: Request, resp: Response):
    resp.body = app.template(
        "index.html", context={"name": "Little-Api", "title": "Best Framework"}
    )

Running with DebugServer

little-api has a wrapper around the gunicorn server to allow for easier debugging

if __name__ == "__main__":
    from little_api.debug_server import DebugServer
    DebugServer(application=app, port=8080).run()

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

little-api-0.0.2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

little_api-0.0.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file little-api-0.0.2.tar.gz.

File metadata

  • Download URL: little-api-0.0.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.2

File hashes

Hashes for little-api-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ec81a6b0910281fda5a4342937afac24ea45f2c5db9726cad8088addc34c2524
MD5 3c2dbd8628a9b8916d955565c1f3532d
BLAKE2b-256 ca07e3e0bed03f97f131e9d93b40b5b029dec19ec994e8e74bd8a284eacc0e09

See more details on using hashes here.

File details

Details for the file little_api-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: little_api-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.2

File hashes

Hashes for little_api-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c35eb3a0703fd74926e1738183afaf58fc70a8889eeada4373489efa2a7beb12
MD5 997f93a918180647d652c6cb1e3875fb
BLAKE2b-256 34847d85533cdd5c79f74517ceac634506adccf9525763cd1a7b038801ec47a7

See more details on using hashes here.

Supported by

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