flask serverless decorator
Project description
Flask Function as a Service
flask-faas
Migrating from serverless to a server application can be a headache at times. flask-faas provides you a layer that sits on top of your existing serverless application handlers and helps them convert to Flask routes. The prime goal is to be easy to use and easier to port. We currently support Google Cloud Function, AWS Lambda and OpenFaaS. We would have Azure Functions on the roadmap shortly.
Just import and use, no extra hassle!
from flask_faas.gcp import google_cloud_function
from flask_faas.aws import aws_lambda
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/gcp/<arg0>",methods=["GET"])
@google_cloud_function
def my_cloud_function_handler(req):
return jsonify(req.view_args)
@app.route("/aws/<arg0>/<arg1>",methods=["GET"])
@aws_lambda
def my_lambda_handler(event, context):
return jsonify([event["pathParameters"]])
if __name__ == '__main__':
app.run()
Supported FaaS handler
- Google Cloud Function
- AWS Lambda
- OpenFaaS
TODO
- Azure Function
Resources:
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flask-faas-0.0.1.tar.gz.
File metadata
- Download URL: flask-faas-0.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84b37a7a529a4f9320ed849c9dc1e9c1ccf87ae8ee0a5be59102f43c82721ab9
|
|
| MD5 |
dd5eb27867b43dbbd340c858d81a27d2
|
|
| BLAKE2b-256 |
5265932e5ddbb6e5229e4889fe55b785dc24f640ad497167a0d6b2ebbbe134ad
|
File details
Details for the file flask_faas-0.0.1-py3-none-any.whl.
File metadata
- Download URL: flask_faas-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2baa117afa0526b3fc9686f5f3e860773a69fb00a62a55a23eb4c9539d035bf0
|
|
| MD5 |
39a9acb7e9d852e602917d85985dd89c
|
|
| BLAKE2b-256 |
ac0b3904c5c1de31d2e3a97e45404f2d4d4ad1d32004a9c2377f205aa48bb8c3
|