Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.06 KB

README.md

File metadata and controls

31 lines (19 loc) · 1.06 KB

Flask Transformer Plugin for Cuttle

Enables converting a Jupyter Notebook to a Flask API project using Cuttle. The plugin works by converting a code cell into function attached to a Flask route (Check Flask Project Layout).

Add required cell scoped configuration

Required config - route, method, response

#cuttle-environment-set-config <environment> route=<route> method=<http method> response=<response variable>
....

Fetch data from request object

The plugin provides the original request object provided by Flask (properties). This can be used along with Cuttle line scoped get config.

Example:

file = open("./images/mnist3.png", "rb") #cuttle-environment-assign mnist-api request.files['file']

This results in:

file = request.files['file']

MNIST API Example Project