This package provides a web application wrapper for your machine learning models.
Project description
Swiftdeploy
Swiftdeploy is a python package that allows you to add a flask web application as a wrapper to your machine learning models. It is most helpful for machine learing developers who don't know how to build web apps. All you need to do is to create your model and add a function that processes the data for your model. Swiftdeploy will take care of the rest.
Table of Contents
Installation
To install Swiftdeploy, run this command in your terminal:
$ pip install swiftdeploy
Usage
Using swiftdeploy is quite easy and will be demonstrated with an example
import sys
from pathlib import Path
from swiftdeploy.settings import config
config.BASE_DIR = Path(__file__).resolve().parent #set the base directory of the project
config.APP_NAME = 'swiftdeploy'
config.APP_HEADER = 'SwiftDeploy'
config.APP_FOOTER = 'SwiftDeploy'
from swiftdeploy.model import MarkupModel #import the MarkupModel class
from swiftdeploy.app import webapp # import the webapp which is a flask app
#Create a fucntion that will process the data for your model, feed the model and return the result
def dummy(params:list) -> list:
return [str(i)+"processed" for i in params]
#Create a dictionary of the parameters you want to collect from the user, note that the values in the dict should match the html input types
param_dict = {
"gender":"text",
"age": "number",
"height": "number",
"weight": "number",
"married": "text",
"educated": "true",
'picture': 'image',
'cv':'file',
'wealthy':'text'
}
my_model = MarkupModel(model_info = "A dummy model you will really like", model_func = dummy,
form_fields = param_dict) #create an instance of the MarkupModel class
config.model = my_model #set the model to the config object, this is important for the webapp to work
if __name__ == "__main__":
webapp.run() #run the webapp, this will start the flask server on port 5000, you can change the run parameters to suit your needs, e.g webapp.run(host="localhost", port=8080, debug=True)
You can visit the webapp at http://localhost:5000 in your browser
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
File details
Details for the file swiftdeply-0.5.tar.gz
.
File metadata
- Download URL: swiftdeply-0.5.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a76211b779f44435d8bd44cbb9920601cefeca9fa965c181b0df9a5dbc21252b |
|
MD5 | fc3783fac260d3252da812ed4eb56bb1 |
|
BLAKE2b-256 | 96cea84332ca4c419d29fdc0bf3d5bd80cc21a72f2b72a164fbb42f8a2b7a7e7 |
File details
Details for the file swiftdeply-0.5-py3-none-any.whl
.
File metadata
- Download URL: swiftdeply-0.5-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0839e639b764c543431b207438484aa078718f49ab15db8750b2231de57984b7 |
|
MD5 | 1fea5950eed47601517b67a31e839331 |
|
BLAKE2b-256 | 7bfaa5acd78c1f36691a9dfcdcba639c4044fb1079c1c15083a05b37ed257757 |