Skip to main content

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


Download files

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

Source Distribution

swiftdeploy-0.5.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

swiftdeploy-0.5.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file swiftdeploy-0.5.1.tar.gz.

File metadata

  • Download URL: swiftdeploy-0.5.1.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

Hashes for swiftdeploy-0.5.1.tar.gz
Algorithm Hash digest
SHA256 ce0c32841850cde4143576cb353369feb3a354a159c4dcdb8dd498b599ff337f
MD5 589ae1b7e6f691b23d7dc51e4b34851b
BLAKE2b-256 21d27d5f1261172f6573b52e9638c046108fdd1217fa0368c2e1fc224a5bd5b3

See more details on using hashes here.

File details

Details for the file swiftdeploy-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: swiftdeploy-0.5.1-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

Hashes for swiftdeploy-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32f6050889e50013cb5f7763309e6dd1ec7a41b426a3bfa20e0593a586d92f64
MD5 dc53921e1962fc9a04ee6fe75530eb33
BLAKE2b-256 551af0ac213e433d94db3e70258fb375657a308e3a2fdd01a3064ad54591090b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page