Skip to main content

polarity-sdk

Python SDK for Polarity — agent evaluation, sandboxed execution, and LLM observability.

This is the canonical install name. It's a thin alias that pulls in polarity-keystone, which ships the actual code. Both names refer to the same package; use whichever feels right.

Install

pip install polarity-sdk

Quickstart

import polarity as plr
from openai import OpenAI

client = plr.wrap(OpenAI())

@plr.traced("workflow")
def run(prompt: str):
    return client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": prompt}],
    )

run("hello world")

Traces appear at https://app.polarity.so.

Configuration

Env var Purpose
POLARITY_API_KEY Required. Get one at https://app.polarity.so
POLARITY_BASE_URL Optional. Defaults to https://api.plr.sh

Legacy KEYSTONE_* env vars continue to work indefinitely.

More

Full docs at https://docs.polarity.so.

Metadata

Release files for polarity-sdk 0.3.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 polarity-sdk 0.3.2
File Size Uploaded Provenance Actions
polarity_sdk-0.3.2.tar.gz 1.8 kB Without provenance Details for polarity_sdk-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polarity-sdk 0.3.2
File Interpreter ABI Platform Actions
polarity_sdk-0.3.2-py3-none-any.whl Python 3 none any Details for polarity_sdk-0.3.2-py3-none-any.whl

Total release size: 3.5 kB

Release files / polarity_sdk-0.3.2.tar.gz

Download URL polarity_sdk-0.3.2.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4ab02fb93cf151fab8645f5e43f4db99effb9c17aefaf3e0ef2a50b7a1a118bc
BLAKE2b-256 checksum
How to use checksums
af04a51e2acb08253bf005d2a63721b72992652324e9f632ffb64bf2e3bab08b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / polarity_sdk-0.3.2-py3-none-any.whl

Download URL polarity_sdk-0.3.2-py3-none-any.whl
Size 1.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de0629965c37039b749295efd93660585d262d2c511c3ef71eeafab9221f5871
BLAKE2b-256 checksum
How to use checksums
683cef33298e934cdcc0507e6b41c8b7e151cf7e0467fc757abaaf1a99b04796
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for polarity-sdk 0.3.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files No provenance

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