Skip to main content

A little library I building to simplify building small web services (mostly APIs) on top of AWS Lambda.

Project description

Deez (Under Development)

A little library I building to simplify building small web services (mostly APIs) on top of AWS Lambda.

DOCUMENTATION TBD

Installation

pip install deez

Example of how to use

Note: The Deez router uses regex for path matching.

app.py

from deez import Deez
from deez.views import Resource
from deez.response import JsonResponse


class HelloWorldView(Resource):
    def get(self, request, *args, **kwargs):
        return JsonResponse(data={'message': 'hello world'})


app = Deez()
app.register_route('^hello/world$', HelloWorldView)

middleware.py

from deez.middleware import Middleware

class User:
    # fake user object
    pass

class AuthMiddleware(Middleware):
    def before_request(self, request):
        # do auth things
        request.user = User() 
        return request

settings.py

# middleware runs before views are called and before the response is returned
# so you can manipulate the response and requests objects.
MIDDLEWARE = ['middleware.AuthMiddleware']

handler.py

from app import app

def handle_event(event, context):
    return app.process_request(event, context)

Project details


Download files

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

Files for deez, version 0.1.51
Filename, size File type Python version Upload date Hashes
Filename, size deez-0.1.51-py3-none-any.whl (10.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size deez-0.1.51.tar.gz (7.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page