The Official Python SDK for Imply Polaris.
Project description
Polaris SDK
The official Python client library that allows developers to interact with and manage their Polaris resources through a abstraction layer on top of the Imply Polaris API.
The main objective of this project is to provide a friendlier interface, speeding up the development processes and ensuring consumers abide by the API contracts.
Getting Started
Prerequisites
- Python >= 3.9.0
Package Installation
To install from pip:
pip install polaris-sdk
Accessing Polaris Resources
Instantiate the appropriate client based on the type of resource you want to access. There are three client types to choose from:
- GlobalClient: For operations related to a Polaris account.
- RegionalClient: For operations related to a specific Polaris regional cloud.
- ProjectClient: For operations specific to a particular Polaris project.
Note: The clients do not maintain open connections or other persistent resources, so it is safe to keep them in memory and reuse the same instance when needed.
Here's a brief example of listing all projects under a Polaris account:
import os
from polaris.sdk.client import GlobalClient
from polaris.sdk.global_api.models import _models
url = os.environ["POLARIS_BASE_URI"]
apikey = os.environ["POLARIS_API_KEY"]
client = GlobalClient.from_endpoint(url, apikey)
projects = client.projects.list()
assert not isinstance(projects, _models.ErrorResponse)
for project in projects:
print(project.metadata.name)
By default the client uses the same retry policy as the Azure SDK for Python. If you'd like to modify this behaviour, follow the example below:
from azure.core.pipeline.policies import RetryPolicy
from polaris.sdk.client import GlobalClient
url = os.environ["POLARIS_BASE_URI"]
apikey = os.environ["POLARIS_API_KEY"]
# Option 1: Pass a retry_policy argument to the client constructor
new_policy = RetryPolicy(retry_total=3, backoff_factor=0.1, retry_mode="fixed")
client = GlobalClient.from_endpoint(url, apikey, retry_policy=new_policy)
# Option 2: Pass parameters as keyword arguments to the client constructor
client = GlobalClient.from_endpoint(url, apikey, retry_total=3)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file polaris_sdk-20250425.14.0.tar.gz
.
File metadata
- Download URL: polaris_sdk-20250425.14.0.tar.gz
- Upload date:
- Size: 695.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6e7785e01e4e2d43c7b36179a9c189da7801dd40bbf521a6d7f399c74e6ca9b |
|
MD5 | 9e2ffcc0f218ae4ba1b4277630151cf2 |
|
BLAKE2b-256 | 6d2baa41c81af27adb9d5c0d4ad11b3bb1499fa2135a38f9c35e5b4c04e1d755 |
Provenance
The following attestation bundles were made for polaris_sdk-20250425.14.0.tar.gz
:
Publisher:
cd-sdk.yml
on implydata/saas-services
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
polaris_sdk-20250425.14.0.tar.gz
- Subject digest:
b6e7785e01e4e2d43c7b36179a9c189da7801dd40bbf521a6d7f399c74e6ca9b
- Sigstore transparency entry: 202971447
- Sigstore integration time:
- Permalink:
implydata/saas-services@a2af0b7fb074021eb251001bbce9a9691e3aa01b
- Branch / Tag:
refs/heads/main
- Owner: https://github.com/implydata
- Access:
private
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
self-hosted
- Publication workflow:
cd-sdk.yml@a2af0b7fb074021eb251001bbce9a9691e3aa01b
- Trigger Event:
workflow_dispatch
- Statement type:
File details
Details for the file polaris_sdk-20250425.14.0-py3-none-any.whl
.
File metadata
- Download URL: polaris_sdk-20250425.14.0-py3-none-any.whl
- Upload date:
- Size: 738.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b650c00ba3cc139b6806d7b7cd736ddd2d11d905f1600f5ffcf217e47342021 |
|
MD5 | 127cad8c1cb4c0273a96c0bfb7d4f332 |
|
BLAKE2b-256 | 8bb7d98936e4c2c1bff4cfa701a80d5d20144cf2d71a6b64da2b1ed7b9686720 |
Provenance
The following attestation bundles were made for polaris_sdk-20250425.14.0-py3-none-any.whl
:
Publisher:
cd-sdk.yml
on implydata/saas-services
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
polaris_sdk-20250425.14.0-py3-none-any.whl
- Subject digest:
0b650c00ba3cc139b6806d7b7cd736ddd2d11d905f1600f5ffcf217e47342021
- Sigstore transparency entry: 202971448
- Sigstore integration time:
- Permalink:
implydata/saas-services@a2af0b7fb074021eb251001bbce9a9691e3aa01b
- Branch / Tag:
refs/heads/main
- Owner: https://github.com/implydata
- Access:
private
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
self-hosted
- Publication workflow:
cd-sdk.yml@a2af0b7fb074021eb251001bbce9a9691e3aa01b
- Trigger Event:
workflow_dispatch
- Statement type: