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)
Metadata
Release files for polaris-sdk 20250425.14.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polaris_sdk-20250425.14.0.tar.gz | 695.8 kB | With provenance | Details for polaris_sdk-20250425.14.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polaris_sdk-20250425.14.0-py3-none-any.whl | Python 3 | none | any | Details for polaris_sdk-20250425.14.0-py3-none-any.whl |
Total release size: 1.4 MB
Release files / polaris_sdk-20250425.14.0.tar.gz
| Download URL | polaris_sdk-20250425.14.0.tar.gz |
|---|---|
| Size | 695.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6e7785e01e4e2d43c7b36179a9c189da7801dd40bbf521a6d7f399c74e6ca9b
|
|
BLAKE2b-256 checksum How to use checksums |
6d2baa41c81af27adb9d5c0d4ad11b3bb1499fa2135a38f9c35e5b4c04e1d755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2025.
Transparency logRelease files / polaris_sdk-20250425.14.0-py3-none-any.whl
| Download URL | polaris_sdk-20250425.14.0-py3-none-any.whl |
|---|---|
| Size | 738.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b650c00ba3cc139b6806d7b7cd736ddd2d11d905f1600f5ffcf217e47342021
|
|
BLAKE2b-256 checksum How to use checksums |
8bb7d98936e4c2c1bff4cfa701a80d5d20144cf2d71a6b64da2b1ed7b9686720
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2025.
Transparency logSecurity for polaris-sdk 20250425.14.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for polaris_sdk-20250425.14.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.