Wrappers around the Tonic.ai API
Project description
Overview
This library contains useful wrappers around the Tonic.ai API.
Usage
Instantiate the API wrapper using the following code:
from tonic_api.api import TonicApi
# Do not include trailing backslash in TONIC_URL
api = TonicApi(TONIC_URL, API_KEY)
Once instantiated, the following endpoints are available for consumption. Note that available endpoints and response types are limited. Available fields may be severely limited compared to the current Tonic API.
TonicApi:
get_workspace(workspace_id) => Workspace
Workspace:
id => string
name => string
models => Model[]
train(model_id) => new job ID
get_trained_model_by_training_job_id(job_id) => TrainedModel (or None if training is not done)
get_training_status_by_training_job_id(job_id) => TrainingJobStatus
get_most_recent_trained_model_by_model_id => TrainedModel
describe() => debugger helper for printing fields
Model:
id => string
name => string
query => string
parameters => {}
encodings => {}
describe() => debugger helper for printing fields
TrainedModel:
id => string
job_id => string
model => Model
sample(num_rows) => pandas DataFrame (defaults to 1 row if num_rows not provided)
sample_source(num_rows) => pandas DataFrame (defaults to 1 row if num_rows not provided). Note: NOT randomized. Upper limit is limited to row count in source.
get_numeric_columns() => string[]
get_categorical_columns() => string[]
describe() => debugger helper for printing fields
TrainingJobStatus:
state => string
error => string[] or None
tasks => {}
current_epoch_progress() => dict or None
describe() => debugger helper for printing fields
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tonic-api-2.1.4.tar.gz
(8.2 kB
view details)
Built Distribution
tonic_api-2.1.4-py3-none-any.whl
(10.0 kB
view details)
File details
Details for the file tonic-api-2.1.4.tar.gz
.
File metadata
- Download URL: tonic-api-2.1.4.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.5 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2583bba43cb89d1fb56468fded698f4f75734c20592507615953085eaede8dbd |
|
MD5 | 1268d3976a67b02325d4d9e1f7b083bd |
|
BLAKE2b-256 | 084e318ef760cdb295d46954a9b52a25e5f67729e3e4bdc0c972f49aca103015 |
File details
Details for the file tonic_api-2.1.4-py3-none-any.whl
.
File metadata
- Download URL: tonic_api-2.1.4-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.5 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ccdae089efa3092acd46608ad4fe722b2887e6d6bdfbffc3e69849f163bced2 |
|
MD5 | dad5a9d5c76a0e2f2ce5f02237d68046 |
|
BLAKE2b-256 | 0fa6716a82f03a289e8b9720533ea4d22536fdedb4be0b3188cdb2af88e72506 |