Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polaris_sdk-20250317.13.1.tar.gz (694.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polaris_sdk-20250317.13.1-py3-none-any.whl (736.7 kB view details)

Uploaded Python 3

File details

Details for the file polaris_sdk-20250317.13.1.tar.gz.

File metadata

  • Download URL: polaris_sdk-20250317.13.1.tar.gz
  • Upload date:
  • Size: 694.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for polaris_sdk-20250317.13.1.tar.gz
Algorithm Hash digest
SHA256 d5c2b8f735d033c16fc86dc18b18d9756972fce411022cca3e0634a0d9065b56
MD5 ac01f96bd1087eef2251dd7374935106
BLAKE2b-256 b8aeb1dde71aff752c923ce1d56e8ca93f3db5732334801963595d2340ab757c

See more details on using hashes here.

Provenance

The following attestation bundles were made for polaris_sdk-20250317.13.1.tar.gz:

Publisher: cd-sdk.yml on implydata/saas-services

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polaris_sdk-20250317.13.1-py3-none-any.whl.

File metadata

File hashes

Hashes for polaris_sdk-20250317.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33ee9e580f724cc9c490167595d9d948b3b25bd2f8d0d58b5f80c2f84b99c8a4
MD5 515626ea1c1d01aae2bd1090bb93f7e9
BLAKE2b-256 67bbd67b1a186edef33a994f315f6ce7ab4aca0fb6820d3d56ece8656e127b70

See more details on using hashes here.

Provenance

The following attestation bundles were made for polaris_sdk-20250317.13.1-py3-none-any.whl:

Publisher: cd-sdk.yml on implydata/saas-services

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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