Skip to main content

Official Python SDK for Parallel Works ACTIVATE

Project description

parallelworks-client

Official Python client for the Parallel Works ACTIVATE platform API.

Installation

pip install parallelworks-client

Quick Start

The simplest way to create a client - just pass your credential:

import os
from parallelworks_client import Client

# The platform host is automatically extracted from your credential
with Client.from_credential(os.environ["PW_API_KEY"]).sync() as client:
    response = client.get("/api/buckets")
    for bucket in response.json():
        print(f"Bucket: {bucket['name']}")

See the examples directory for complete runnable examples.

Authentication

Automatic Host Detection

API keys (pwt_...) and JWT tokens contain the platform host encoded within them. Use from_credential to automatically extract it:

# API key - host decoded from first segment after pwt_
client = Client.from_credential("pwt_Y2xvdWQucGFyYWxsZWwud29ya3M.xxxxx")
# Connects to: https://activate.parallel.works

# JWT token - host read from platform_host claim
client = Client.from_credential("eyJhbGci...")
# Connects to the host in the token's platform_host claim

Explicit Host

If you prefer to specify the host explicitly:

# API Key (Basic Auth) - best for long-running integrations
client = Client.with_api_key(
    "https://activate.parallel.works",
    "pwt_..."
)

# JWT Token (Bearer) - best for scripts, expires in 24h
client = Client.with_token(
    "https://activate.parallel.works",
    "eyJhbGci..."
)

# Auto-detect credential type
client = Client.with_credential(
    "https://activate.parallel.works",
    os.environ["PW_CREDENTIAL"]
)

Credential Helpers

from parallelworks_client import is_api_key, is_token, extract_platform_host

is_api_key("pwt_abc.xyz")           # True
is_token("eyJ.abc.def")             # True
extract_platform_host("pwt_...")    # "activate.parallel.works"

Async Support

import asyncio
from parallelworks_client import Client

async def main():
    async with Client.from_credential(os.environ["PW_API_KEY"]) as client:
        response = await client.get("/api/buckets")
        print(response.json())

asyncio.run(main())

Documentation

For full API documentation, visit https://parallelworks.com/docs.

License

MIT

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

parallelworks_client-6.12.0.tar.gz (38.6 kB view details)

Uploaded Source

Built Distribution

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

parallelworks_client-6.12.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file parallelworks_client-6.12.0.tar.gz.

File metadata

  • Download URL: parallelworks_client-6.12.0.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for parallelworks_client-6.12.0.tar.gz
Algorithm Hash digest
SHA256 0137b29cec4e7d8491e71caa10bcf0c8718230b1e2b79b4b9a0cbefbfe560574
MD5 22d19f8df3399db47f3a9f6920b55389
BLAKE2b-256 75fde509826af8cbd78609a3e4d378c1a04c3f8b91584f3f1ef0c3b6a4338511

See more details on using hashes here.

File details

Details for the file parallelworks_client-6.12.0-py3-none-any.whl.

File metadata

  • Download URL: parallelworks_client-6.12.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for parallelworks_client-6.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a6299a1b86b0b6805966f205f177e2fed1e715c67fe0f1ce865ce142b69197f
MD5 067e94a0559dc35ae551f0b3bd70f50a
BLAKE2b-256 62ad30597249784f5d2f36e534378f79a7dd3d1b75c4b254c36c7c05a36cbf47

See more details on using hashes here.

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