Metadata-Version: 2.1
Name: flask-faas
Version: 0.0.1
Summary: flask serverless decorator
Home-page: https://github.com/Glitchfix/flask-faas
Author: Shivanjan Chakravorty
Author-email: schakravorty846@gmail.com
License: MIT
Download-URL: https://github.com/Glitchfix/flask-faas/archive/refs/tags/0.1.tar.gz
Project-URL: Bug Tracker, https://github.com/Glitchfix/flask-faas/issues
Keywords: flask,serverless,faas,flask-serverless,lambda,cloud function,flask serverless
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: flask
Requires-Dist: pytest

# Flask Function as a Service

[![Linkedin Badge](https://img.shields.io/badge/-Shivanjan%20Chakravorty-blue?style=plastic&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/shivanjan/)](https://www.linkedin.com/in/shivanjan/) [![Gmail Badge](https://img.shields.io/badge/-schakravorty846-c14438?style=plastic&logo=Gmail&logoColor=white&link=mailto:schakravorty846@gmail.com)](mailto:schakravorty846@gmail.com) [![Github Badge](https://img.shields.io/github/followers/Glitchfix?label=Glitchfix&logo=github&style=plastic)](https://github.com/Glitchfix)


## 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](https://cloud.google.com/functions/), [AWS Lambda](https://aws.amazon.com/lambda/) and [OpenFaaS](https://www.openfaas.com/). We would have Azure Functions on the roadmap shortly.


## Just import and use, no extra hassle!

```py
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

- [x] Google Cloud Function
- [x] AWS Lambda
- [x] OpenFaaS

### TODO
- [ ] Azure Function


##### Resources: 
[Flask](https://flask.palletsprojects.com/)
[Google Cloud Function](https://cloud.google.com/functions/)
[AWS Lambda](https://aws.amazon.com/lambda/)
[OpenFaaS](https://www.openfaas.com/)


