Skip to main content

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://cloud.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://cloud.parallel.works",
    "pwt_..."
)

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

# Auto-detect credential type
client = Client.with_credential(
    "https://cloud.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_...")    # "cloud.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())

Errors

The client asks for errors as RFC 9457 problem details, in the language of the locale environment (LC_ALL, LC_MESSAGES, LANG). raise_for_problem raises any failed response, including an older server's error envelope, as a ProblemError with a stable code, params, the server's detail, and the invalid fields in errors:

from parallelworks_client import Client, ProblemError, raise_for_problem

with Client.from_credential(os.environ["PW_API_KEY"]).sync() as client:
    try:
        raise_for_problem(client.get("/api/buckets"))
    except ProblemError as problem:
        print(problem.code, problem.detail)
        for field in problem.errors:
            print(f"  {field}")

Documentation

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

License

Apache-2.0

Metadata

Release files for parallelworks-client 7.114.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parallelworks-client 7.114.0
File Size Uploaded Provenance Actions
parallelworks_client-7.114.0.tar.gz 764.0 kB Without provenance Details for parallelworks_client-7.114.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parallelworks-client 7.114.0
File Interpreter ABI Platform Actions
parallelworks_client-7.114.0-py3-none-any.whl Python 3 none any Details for parallelworks_client-7.114.0-py3-none-any.whl

Total release size: 3.4 MB

Release files / parallelworks_client-7.114.0.tar.gz

Download URL parallelworks_client-7.114.0.tar.gz
Size 764.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7f58d780c364b9fcca6fd52607f53cf3fbfe98a2258fd1755578f7e316802958
BLAKE2b-256 checksum
How to use checksums
4f5547f6bb57988a652a08c89f549e2675ea5c7c25d2074f3cdf1e5c949e62b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / parallelworks_client-7.114.0-py3-none-any.whl

Download URL parallelworks_client-7.114.0-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a9213def47e9e3bf8a273cf0869fe5017b057c2999adf270c41b233dfe6fa1ad
BLAKE2b-256 checksum
How to use checksums
e7b979a41f5de6a2880e4cc2fcf9353c529bf32d6ae5f2b8e361f646832fe051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for parallelworks-client 7.114.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.

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

7.114.0 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