Skip to main content

Python client for Teradata AnalyticOps Accelerator (AOA)

Project description

Teradata AnalyticOps Client

Python client for Teradata AnalyticOps Accelerator. It is composed of both an client API implementation to access the AOA Core APIs and a command line interface (cli) tool which can be used for many common tasks.

Installation

You can install via pip. The minimum python version required is 3.5+

pip install aoa

CLI

The cli can be used to perform a number of interactions and guides the user to perform those actions.

> aoa -h
usage: aoa [-h] [--debug] {add,run,init,clone,configure} ...

AOA CLI

optional arguments:
  -h, --help            show this help message and exit
  --debug               Enable debug logging

actions:
  valid actions

  {add,run,init,clone,configure}
    add                 Add model
    run                 Train and Evaluate model
    init                Initialize model directory with basic structure
    clone               Clone Project Repository
    configure           Configure AOA client

To see the details or help for a specific action, just select the action and add -h

> aoa run -h
usage: aoa run [-h] [-id MODEL_ID] [-m MODE] [-d DATA]

optional arguments:
  -h, --help            show this help message and exit
  -id MODEL_ID, --model_id MODEL_ID
                        Which model_id to use (prompted to select if not provided)
  -m MODE, --mode MODE  The model (train or evaluate) (prompted to select if not provided)
  -d DATA, --data DATA  Json file containing data configuration (prompted to select if not provided)

Client API

We have a client implementation for all of the entities exposed in the AOA API. We provide the RESTful and RPC client usage for this. We'll show an example of the Dataset API here but the same applies for all.

To configure the client you simply run the cli which will guide you through the process and create the configuration file .aoa/config.yaml in your home directly. Note you can override this configuration at runtime via environment variables or constructor arguments.

aoa configure

Create the client. Note there are a number of options to specify the client information and credentials. The example here is where you specify everything in the constructor.

from aoa import AoaClient
from aoa import DatasetApi


client = AoaClient()
client.set_project_id("23e1df4b-b630-47a1-ab80-7ad5385fcd8d")

dataset_api = DatasetApi(aoa_client=client)

Now, find all datasets or a specific dataset

import pprint

datasets = dataset_api.find_all()
pprint.pprint(datasets)

dataset = dataset_api.find_by_id("11e1df4b-b630-47a1-ab80-7ad5385fcd8c")
pprint.pprint(dataset)

Add a dataset

dataset_definition = {
    "name": "my dataset",
    "description": "adding sample dataset",
    "metadata": {
        "url": "http://nrvis.com/data/mldata/pima-indians-diabetes.csv",
        "test_split": "0.2"
    }
}

dataset = dataset_api.save(dataset=dataset_definition)
pprint.pprint(dataset)

Project details


Download files

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

Source Distribution

aoa-2.5.3.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aoa-2.5.3-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file aoa-2.5.3.tar.gz.

File metadata

  • Download URL: aoa-2.5.3.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.4.2 requests/2.18.4 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.5

File hashes

Hashes for aoa-2.5.3.tar.gz
Algorithm Hash digest
SHA256 9ca3000e6f3accad78caad95dfd8f75c9e608dc257f42f0962f6639f4c69ba35
MD5 39883dce64a2160b523b5c15107035a9
BLAKE2b-256 beb2967e2188f827abe90ab9032018b2c5b907f653950ba61fd4a5ba6b950389

See more details on using hashes here.

File details

Details for the file aoa-2.5.3-py3-none-any.whl.

File metadata

  • Download URL: aoa-2.5.3-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.4.2 requests/2.18.4 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.5

File hashes

Hashes for aoa-2.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7243eb64c95f4d14461bbf6359d545371192de54f52ba6705e332443b96f88cc
MD5 36178230f6fc3d5f96c710d4a5dec477
BLAKE2b-256 694e76a382a3ddafa5255dab1c51a49c7e0fac588890b2ad1f6c721596ecf169

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page