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.1.tar.gz (29.0 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.1-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aoa-2.5.1.tar.gz
  • Upload date:
  • Size: 29.0 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.1.tar.gz
Algorithm Hash digest
SHA256 2d35086e6273d83405f9ee3541c25e5a49ac2de6061e6bce73949420bf0cd1f8
MD5 f911171dca8a2a16602fde10eb2139f0
BLAKE2b-256 656bf3e13dcf731bf24234d2e3251f9cf66096ebd322c7b486e61cc98ba80ab0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aoa-2.5.1-py3-none-any.whl
  • Upload date:
  • Size: 43.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e490b9f47e9b42a6c7247a83d7e8f2389af042e8c5894a12fb3b9360ba721055
MD5 97cee9d85bf3a8a7c83ad6809214588e
BLAKE2b-256 a57887283d47b37ef5750b1d6e272b03c7a75647000dec4e71a61005cf0253d2

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