Public Python SDK for calling remote functions, with sync and async clients.
Project description
paperclip-sdk
Public Python SDK for calling Paperclip remote functions.
Install
poetry add paperclip-sdk
or
pip install paperclip-sdk
Configure authentication
export LEASEKEY_API_KEY="your-api-key"
Sync usage
from paperclip_sdk import PaperclipClient
with PaperclipClient(base_url="https://leasekey.org") as client:
result = client.call("core.hello_world", name="Ada")
print(result)
Async usage
import asyncio
from paperclip_sdk import AsyncPaperclipClient
async def main() -> None:
async with AsyncPaperclipClient(base_url="https://leasekey.org") as client:
result = await client.call("core.hello_world", name="Ada")
print(result)
asyncio.run(main())
Function handles
from paperclip_sdk import PaperclipClient
with PaperclipClient(base_url="https://leasekey.org") as client:
hello_world = client.function("core.hello_world")
print(hello_world("Ada"))
Async function handles
import asyncio
from paperclip_sdk import AsyncPaperclipClient
async def main() -> None:
async with AsyncPaperclipClient(base_url="https://leasekey.org") as client:
hello_world = client.function("core.hello_world")
print(await hello_world("Ada"))
asyncio.run(main())
Typed exceptions
from paperclip_sdk import (
PaperclipAuthenticationError,
PaperclipNotFoundError,
PaperclipPermissionError,
PaperclipRateLimitError,
PaperclipServerError,
PaperclipTransportError,
PaperclipInvalidResponseError,
)
Notes
- The default base URL is
https://leasekey.org, so passingbase_urlis optional. - The SDK automatically sends
User-Agent: paperclip-sdk/<version>. - The SDK also sends
X-Leasekey-SDK-Version: <version>. - Built-in retry behavior covers retryable transport failures and these HTTP statuses:
408,425,429,502,503,504.
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
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 paperclip_sdk-0.2.0.tar.gz.
File metadata
- Download URL: paperclip_sdk-0.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dcd7d99ed637843054f25974bb25fc1b6fd08458f50b2b5a3e00594b5a0f15c
|
|
| MD5 |
11816ed2ee439acdb5e25482bd58dedd
|
|
| BLAKE2b-256 |
00e550fa11c8573e16fdbed46352bf19a453af5f99e4ea7aa01c9c9b8c0179ee
|
Provenance
The following attestation bundles were made for paperclip_sdk-0.2.0.tar.gz:
Publisher:
publish.yml on janfilips/paperclip-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paperclip_sdk-0.2.0.tar.gz -
Subject digest:
6dcd7d99ed637843054f25974bb25fc1b6fd08458f50b2b5a3e00594b5a0f15c - Sigstore transparency entry: 1102606355
- Sigstore integration time:
-
Permalink:
janfilips/paperclip-server@e3519f788b7404c4577f8f1b7cc344dde3dd4013 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/janfilips
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e3519f788b7404c4577f8f1b7cc344dde3dd4013 -
Trigger Event:
release
-
Statement type:
File details
Details for the file paperclip_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: paperclip_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ab28c5bd36ceb663b165f32ffa3171f13acaf2d18433e0e25112ea5f81e0851
|
|
| MD5 |
ed0668cfbd96a5c9e018c2cb698fdc3a
|
|
| BLAKE2b-256 |
8f922fda9e8c8931526788c5e524d881a93b6a425e8548b840fc28819682a348
|
Provenance
The following attestation bundles were made for paperclip_sdk-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on janfilips/paperclip-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paperclip_sdk-0.2.0-py3-none-any.whl -
Subject digest:
7ab28c5bd36ceb663b165f32ffa3171f13acaf2d18433e0e25112ea5f81e0851 - Sigstore transparency entry: 1102606357
- Sigstore integration time:
-
Permalink:
janfilips/paperclip-server@e3519f788b7404c4577f8f1b7cc344dde3dd4013 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/janfilips
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e3519f788b7404c4577f8f1b7cc344dde3dd4013 -
Trigger Event:
release
-
Statement type: