Python Client

For a Python model to be deployed to Promote, the model needs to include information from the Promote library. The library includes a number of methods used in the various stages of deployment.

Please visit our Github repository for more information on how to deploy models using the Python client.

Directory Structure Requirements

For all model dependencies to be correctly transferred to Alteryx Promote, you must follow a particular directory structure with the model folder containing:

  • promote.sh: A file that is executed before your model is built. This file can be used to install low-level system packages, such as Linux.
  • main.py: The primary model deployment script.
  • helpers/: An optional directory where helper functions can be saved.
  • objects/: An optional directory where pickle files or other data fields needed for model execution can be saved.
  • requirements.txt: A file containing a list of the packages required to run your model. This file must include the promote package.

Functions and methods

Promote.metadata: A method that assigns related metadata to the model so the metadata is visible from within the Promote platform. Metadata is assigned individually, with a maximum of six metadata values per model, each with no more than 50 characters.

Promote.deploy: A method that captures promoteModel() and the related files in the model directory to send to the Promote servers.

Promote.predict: A method that sends data to a deployed model for a prediction. This method uses a REST API request from R.

@promote.validate_json: An optional decorator used to validate data passed into a model. This function requires the schema package to validate JSON.