Skip to main content

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 passing base_url is 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

paperclip_sdk-0.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

paperclip_sdk-0.2.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

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

Hashes for paperclip_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6dcd7d99ed637843054f25974bb25fc1b6fd08458f50b2b5a3e00594b5a0f15c
MD5 11816ed2ee439acdb5e25482bd58dedd
BLAKE2b-256 00e550fa11c8573e16fdbed46352bf19a453af5f99e4ea7aa01c9c9b8c0179ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for paperclip_sdk-0.2.0.tar.gz:

Publisher: publish.yml on janfilips/paperclip-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for paperclip_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ab28c5bd36ceb663b165f32ffa3171f13acaf2d18433e0e25112ea5f81e0851
MD5 ed0668cfbd96a5c9e018c2cb698fdc3a
BLAKE2b-256 8f922fda9e8c8931526788c5e524d881a93b6a425e8548b840fc28819682a348

See more details on using hashes here.

Provenance

The following attestation bundles were made for paperclip_sdk-0.2.0-py3-none-any.whl:

Publisher: publish.yml on janfilips/paperclip-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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