Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Tangram for Python

Project description

Tangram + Python

The Tangram Python library makes it easy to make predictions with your Tangram machine learning model from Python.


$ pip install tangram
import tangram

model = tangram.Model.from_file('./heart-disease.tangram')

input = {
  'age': 63,
  'gender': 'male',
  # ...

output = model.predict(input)


For more information, read the docs.

Platform Support

tangram-python is currently supported for Linux, macOS, and Windows on x64-64/amd64/x64 CPUs. Are you interested in another platform? Get in touch via email at or with the chat bubble on our website at


This repo contains two examples, examples/predict and examples/monitor.


This example demonstrates loading a model from a .tangram file and making a prediction.


This example demonstrates logging predictions and true values to the Tangram reporting and monitoring app. Before running the example, upload the heart-disease.tangram file in examples/monitor/heart-disease.tangram to either or your private instance. Then generate a token by clicking the "Tokens" link on the right side of the top bar.

Then you can run the example:

$ TANGRAM_TOKEN=<YOUR TOKEN HERE> python3 examples/monitor/

Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values being reported.

For more information on reporting and monitoring, read the docs.

Project details

Download files

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

Files for tangram, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size tangram-0.1.3.tar.gz (4.0 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page