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

Uploaded Source

Built Distribution

polaris_sdk-20250425.14.0-py3-none-any.whl (738.0 kB view details)

Uploaded Python 3

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

Hashes for polaris_sdk-20250425.14.0.tar.gz
Algorithm Hash digest
SHA256 b6e7785e01e4e2d43c7b36179a9c189da7801dd40bbf521a6d7f399c74e6ca9b
MD5 9e2ffcc0f218ae4ba1b4277630151cf2
BLAKE2b-256 6d2baa41c81af27adb9d5c0d4ad11b3bb1499fa2135a38f9c35e5b4c04e1d755

See more details on using hashes here.

Provenance

The following attestation bundles were made for polaris_sdk-20250425.14.0.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-20250425.14.0-py3-none-any.whl.

File metadata

File hashes

Hashes for polaris_sdk-20250425.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b650c00ba3cc139b6806d7b7cd736ddd2d11d905f1600f5ffcf217e47342021
MD5 127cad8c1cb4c0273a96c0bfb7d4f332
BLAKE2b-256 8bb7d98936e4c2c1bff4cfa701a80d5d20144cf2d71a6b64da2b1ed7b9686720

See more details on using hashes here.

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

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 Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page