Skip to content
AIR-CoreDevelopersOpen AIR-Core
On this page

Python SDK

deepint is the Python library of AIR-Core: it wraps the REST API with objects for organizations, workspaces, sources, models, visualizations, dashboards and tasks, and works with pandas.

Install

Version 1.6.0, with the new features of AIR-Core (explanations, model card, AI activity), installs from its repository:

python3 -m pip install "git+https://github.com/deepintdev/deepint-python-sdk"

python3 -m pip install deepint installs the latest version on PyPI, which is older.

Credentials

Create a token in Account → API and AI applications → New token (it is shown only when you create it: copy it then) and give it to the SDK in one of these ways, in this order of priority:

  1. In the code: Credentials.build(token="…", instance="app.air-core.io").
  2. Environment variables AIRCORE_TOKEN and AIRCORE_INSTANCE (DEEPINT_TOKEN and DEEPINT_INSTANCE still work).
  3. A ~/.deepint.ini file with token and instance in the [DEFAULT] section.

Without an instance, app.air-core.io is used.

First steps

import pandas as pd
from deepint import Organization, ModelType, ModelMethod

org = Organization.build(organization_id="<organization ID>")
ws = org.workspaces.fetch(name="Sales")

# A source from a DataFrame (columns, names and types included)
data = pd.read_csv("sales.csv")
source = ws.sources.create_and_initialize(name="Sales 2026", description="", data=data)

# A model that predicts a column
model = ws.models.create(name="Repeat purchase", description="", model_type=ModelType.classifier,
                         method=ModelMethod.forest, source=source, target_feature_name="repeats")

# Evaluation, model card and explanation
print(model.predictions.evaluation())
print(model.card(lang="en"))
print(model.explanations.global_importances(lang="en"))

# Predictions
new_rows = data.drop(columns=["repeats"]).head(5)
print(model.predictions.predict_batch(new_rows))

Long operations (importing data, training) return a task: task.resolve() waits until it ends.

More