Skip to main content

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

Metadata

Release files for primehub-python-sdk 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for primehub-python-sdk 0.4.2
File Size Uploaded
primehub-python-sdk-0.4.2.tar.gz 80.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for primehub-python-sdk 0.4.2
File Interpreter ABI Platform
primehub_python_sdk-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 191.5 kB

Release files / primehub-python-sdk-0.4.2.tar.gz

Download URL primehub-python-sdk-0.4.2.tar.gz
Size 80.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a66cd51b3f7c26978bb53317472c43aacd918b3646d893fea1d42d3dbc1c5fa9
BLAKE2b-256 checksum
How to use checksums
4a9921513ba7dd8c96b85b5b5de0af1142d7d3715317a1601f73c20a66f182b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.16

Release files / primehub_python_sdk-0.4.2-py3-none-any.whl

Download URL primehub_python_sdk-0.4.2-py3-none-any.whl
Size 110.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fffbe856026afcf98086069fd793eefef85db282e54ea58920abbf14c4586646
BLAKE2b-256 checksum
How to use checksums
31423b9832208b01f60f993baa4bed493c4c1fd12c88fabb13df95af4c219bb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.16

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page