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.2.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.2-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aoa-2.5.2.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.2.tar.gz
Algorithm Hash digest
SHA256 de605ebc9ecd70b9832b396f37af8af3ef783b179cb8d4f7794062f6094539c4
MD5 c3e0f7ef64cbb8364c5bc2e97c326729
BLAKE2b-256 f8efb6fd4c28ebe93e4770a3a9787bbf7ffcbd1065dd318422b6f04827142b20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aoa-2.5.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38a6d03cd8e8593458685d67a3216a22fadda76eea0aa5faab31cc27e01dddd2
MD5 109724a1798f3491093244ac4e4add25
BLAKE2b-256 0d9d4b6c74fd7ea61cb6e39d3fea2600ce14cbe2c0144612a9569b40c09da52f

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