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://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())
Documentation
For full API documentation, visit https://parallelworks.com/docs.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parallelworks_client-7.18.1.tar.gz.
File metadata
- Download URL: parallelworks_client-7.18.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed0104875e3a9067fffb04c1551fbd2b271b9f0b025ed3f4430cff5b2755fffd
|
|
| MD5 |
4d654edc37352804c13533cb7940210b
|
|
| BLAKE2b-256 |
43d1b77851a2ee3eead13511191fa97649565239bc2dd132bedb023df6e0050a
|
File details
Details for the file parallelworks_client-7.18.1-py3-none-any.whl.
File metadata
- Download URL: parallelworks_client-7.18.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
130097b5140258c42e59fd82f6f18904f1d858eadb298acab5133875fad96b51
|
|
| MD5 |
0a17b0d1b1ce251249deac2beaf3aeb3
|
|
| BLAKE2b-256 |
9b0fb83e755020b3662541a68cba1bcca18470116c960ec64d17505da28758ce
|