Skip to main content

PrimeHub Python SDK

Project description

PrimeHub Python SDK

PrimeHub Python SDK is the PrimeHub AI Platform Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Job and Deployment.

Getting Started

Assuming that you have Python, you can install the library using pip:

$ pip install primehub-python-sdk

Or trying the latest from our source code:

$ pip install git+https://github.com/InfuseAI/primehub-python-sdk.git@main

Using CLI

After installing PrimeHub Python SDK

Next, set up the configuration in ~/.primehub/config.json:

{
  "api-token": "<api-token>",
  "endpoint": "https://<primehub-domain>/api/graphql",
  "group": {
    "name": "<group-name>"
  }
}

The <api-token> could be generated from User Portal.

Then, from a shell:

$ primehub me
id:             a7db12dc-04fa-419c-9cd7-af768575a871
username:       phadmin
firstName:      None
lastName:       None
email:          dev+phadmin@infuseai.io
isAdmin:        True

Running primehub without arguments to show help:

$ primehub
Usage:
  primehub <command>

Available Commands:
  admin                Commands for system administrator
  apps                 Manage PrimeHub Applications
  apptemplates         Get PhAppTemplates
  config               Update the settings of PrimeHub SDK
  datasets             Manage datasets
  deployments          Get a deployment or list deployments
  files                List and download shared files
  groups               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                 Manage jobs
  me                   Show user account
  models               Manage models
  notebooks            Get notebooks logs
  recurring-jobs       Manage recurring jobs
  version              Display the version of PrimeHub Python SDK
  volumes              Get a volume or list volumes

Options:
  -h, --help           Show the help

Global Options:
  --config CONFIG      Change the path of the config file (Default: ~/.primehub/config.json)
  --endpoint ENDPOINT  Override the GraphQL API endpoint
  --token TOKEN        Override the API Token
  --group GROUP        Override the current group
  --json               Output the json format (output human-friendly format by default)

SDK

from a Python interpreter:

In [1]: from primehub import PrimeHub, PrimeHubConfig

In [2]: ph = PrimeHub(PrimeHubConfig())

In [3]: ph.me.me()
Out[3]:
{'id': 'a7db12dc-04fa-419c-9cd7-af768575a871',
 'username': 'phadmin',
 'firstName': None,
 'lastName': None,
 'email': 'dev+phadmin@infuseai.io',
 'isAdmin': True}

In [4]:

Docs

There is a docs folder in our repository. You could find:

  • CLI: all commands usage examples
  • notebook: examples written in python

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.4.1.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

primehub_python_sdk-0.4.1-py3-none-any.whl (110.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: primehub-python-sdk-0.4.1.tar.gz
  • Upload date:
  • Size: 80.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for primehub-python-sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 24e87ca70aa3f8f9d064d0498e4a541a16536577d3c98ec88f69ff57b6e8d0cf
MD5 d02a120819b5ec9f216d58a5e5947977
BLAKE2b-256 8823365d9228aa043926ba9c3b4d91be549212105a3b66ebc552c3c9e2a88805

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for primehub_python_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6404ccf78a77140d92b008b2811e89a08937e730d94e64e6ca9aa2db5ee5cb80
MD5 ede572727d7b45cae4159f38e47ed1a4
BLAKE2b-256 c50e1a689ca1d42227ad319f29506b9a5fd6b06b235efffb38194b21e1d215a2

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