# 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
```
Raw data
{
"_id": null,
"home_page": "https://www.tonic.ai/",
"name": "tonic-api",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "tonic.ai,tonic",
"author": "Eric Timmerman",
"author_email": "eric@tonic.ai",
"download_url": "https://files.pythonhosted.org/packages/08/4e/318ef760cdb295d46954a9b52a25e5f67729e3e4bdc0c972f49aca103015/tonic-api-2.1.4.tar.gz",
"platform": null,
"description": "# Overview\nThis library contains useful wrappers around the Tonic.ai API.\n\n## Usage\n\nInstantiate the API wrapper using the following code:\n\n```\nfrom tonic_api.api import TonicApi\n\n# Do not include trailing backslash in TONIC_URL\napi = TonicApi(TONIC_URL, API_KEY)\n```\n\nOnce 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.\n\n```\nTonicApi:\n get_workspace(workspace_id) => Workspace\n\nWorkspace:\n id => string\n name => string\n models => Model[]\n\n train(model_id) => new job ID\n get_trained_model_by_training_job_id(job_id) => TrainedModel (or None if training is not done)\n get_training_status_by_training_job_id(job_id) => TrainingJobStatus\n get_most_recent_trained_model_by_model_id => TrainedModel\n\n describe() => debugger helper for printing fields\n\nModel:\n id => string\n name => string\n query => string\n parameters => {}\n encodings => {}\n\n describe() => debugger helper for printing fields\n\nTrainedModel:\n id => string\n job_id => string\n model => Model\n\n sample(num_rows) => pandas DataFrame (defaults to 1 row if num_rows not provided)\n 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.\n\n get_numeric_columns() => string[]\n get_categorical_columns() => string[]\n\n describe() => debugger helper for printing fields\n\nTrainingJobStatus:\n state => string\n error => string[] or None\n tasks => {}\n\n current_epoch_progress() => dict or None\n\n describe() => debugger helper for printing fields\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Wrappers around the Tonic.ai API",
"version": "2.1.4",
"split_keywords": [
"tonic.ai",
"tonic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0fa6716a82f03a289e8b9720533ea4d22536fdedb4be0b3188cdb2af88e72506",
"md5": "dad5a9d5c76a0e2f2ce5f02237d68046",
"sha256": "3ccdae089efa3092acd46608ad4fe722b2887e6d6bdfbffc3e69849f163bced2"
},
"downloads": -1,
"filename": "tonic_api-2.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dad5a9d5c76a0e2f2ce5f02237d68046",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 9992,
"upload_time": "2023-02-09T23:42:48",
"upload_time_iso_8601": "2023-02-09T23:42:48.233984Z",
"url": "https://files.pythonhosted.org/packages/0f/a6/716a82f03a289e8b9720533ea4d22536fdedb4be0b3188cdb2af88e72506/tonic_api-2.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "084e318ef760cdb295d46954a9b52a25e5f67729e3e4bdc0c972f49aca103015",
"md5": "1268d3976a67b02325d4d9e1f7b083bd",
"sha256": "2583bba43cb89d1fb56468fded698f4f75734c20592507615953085eaede8dbd"
},
"downloads": -1,
"filename": "tonic-api-2.1.4.tar.gz",
"has_sig": false,
"md5_digest": "1268d3976a67b02325d4d9e1f7b083bd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 8170,
"upload_time": "2023-02-09T23:42:45",
"upload_time_iso_8601": "2023-02-09T23:42:45.971313Z",
"url": "https://files.pythonhosted.org/packages/08/4e/318ef760cdb295d46954a9b52a25e5f67729e3e4bdc0c972f49aca103015/tonic-api-2.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-09 23:42:45",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "tonic-api"
}