Skip to main content

PrimeHub Python SDK

Project description

PrimeHub Python SDK

PrimeHub Python SDK provides a python library to communicate with PrimeHub API

Installation

Install the SDK from source code

git clone https://github.com/InfuseAI/primehub-python-sdk.git
cd primehub-python-sdk
pip install -e .[dev]

Verify it with primehub command:

Usage:
  primehub <command>

Available Commands:
  config               Update the settings of PrimeHub SDK
  datasets             Get a dataset or list datasets
  files                List and download shared files
  group                Get a group or list groups
  images               Get a image or list images
  info                 Display the user information and the selected group information
  instancetypes        Get an instance types of list instance types
  jobs                 Get a job or list jobs
  me                   Show user account
  notebooks            Get notebooks logs
  schedules            Get a schedule or list schedules

Options:
  -h, --help           Show the help

Global Options:
  --config CONFIG      the path of the config file
  --endpoint ENDPOINT  the endpoint to the PrimeHub GraphQL URL
  --token TOKEN        API Token generated from PrimeHub Console
  --group GROUP        override the active group

Configuration

PrimeHub Python SDK needs the ~/.primehub/config.json to connect to your PrimeHub API server.

{
  "api-token": "<api-token>",
  "endpoint": "https://<primehub-server-domain>/api/graphql",
  "group": {
    "name": "<the-name-of-current-group>"
  }
}
  • api-token and endpoint: please generate your own api-token and get the endpoint from the PrimeHub Console
  • group: the name of a group. If the SDK did a group-context aware query, the group name would be used. It would raise an exception when the group was not available.

The configuration could verify by me

$ primehub me | jq .
{
  "id": "a932f38d-cca7-4846-5566-b2958949e7c9",
  "username": "jovyan",
  "firstName": "",
  "lastName": "",
  "email": "jovyan@infuseai.io,
  "isAdmin": true
}

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

primehub-python-sdk-0.1.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

primehub_python_sdk-0.1.0-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file primehub-python-sdk-0.1.0.tar.gz.

File metadata

  • Download URL: primehub-python-sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.14

File hashes

Hashes for primehub-python-sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e030e4ca8618e81def5f2765b4da9ff37b8da2c1be7fc3f9c14488aab9f72df2
MD5 19ce23584d0939df6d7698d8811c24d7
BLAKE2b-256 1732e8019583d31815778189d4e60692bf734be92faac5f70a7db1c95bf98ac6

See more details on using hashes here.

File details

Details for the file primehub_python_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: primehub_python_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.14

File hashes

Hashes for primehub_python_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f17f9b2a3d0598064c65380563699c46585cd3bc953a27b3d5caf8055f98aee
MD5 9938eb99d6fd2fc73d781e688aafb5e7
BLAKE2b-256 da049cee5fe9443afdf08f31d9f68f2dd4e9ed70d0f3c176aeae9f2475d3f1c7

See more details on using hashes here.

Supported by

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