Integrate Spavik into your application

Install the Python or JavaScript SDK, or call the REST API from your application.

Install an SDK
Python
$ pip install spavik
JavaScript
$ npm install spavik
The SDK reads your key from the SPAVIK_API_KEY variable.

Installation and code examples

Python library

Evaluate your history, create a model and make predictions in Python. The SDK supports synchronous and asynchronous calls.

$ pip install spavik
app.py
from spavik import Spavik

spavik = Spavik()                        # reads SPAVIK_API_KEY

# 1. check whether the data can predict churn
report = spavik.evaluate("churn.csv", target="churn")
report["assessment"]["status"]           # 'better_than_baseline', ...

# 2. create the model
model = spavik.train("churn.csv", target="churn")

# 3. predict churn for a new customer
r = model.predict({"plan": "pro", "seats": 12, "tickets_90d": 3})
r.lignes[0]      # {'request_id': 'req_...', 'prediction': 0, ...}

Access the API

Create an API key in your workspace to authenticate requests.