Skip to main content

Python SDK for AWS Lambda.

Project description

Getting Started

Installation

pip install capo-lambda

Usage

from capo_lambda import AsyncLambdaClient


async def main():
    async with AsyncLambdaClient() as s3:
        # Example: call the checkpoint_durable_execution operation
        response = await s3.checkpoint_durable_execution()
        print(response["checkpoint_token"])

Pagination

Some operations in this SDK support pagination. If the operation supports pagination it will have an iter_ prefixed method that returns an async iterator.

from capo_lambda import AsyncLambdaClient


async def main():
    async with AsyncLambdaClient() as s3:
        # Example: paginate over get_durable_execution_history
        async for item in s3.iter_get_durable_execution_history():
            print(item)

Error Handling

The SDK raises exceptions for errors returned by the API. Catch them to handle failures gracefully.

from capo_lambda import AsyncLambdaClient
from capo_lambda.error import InvalidParameterValueException


async def main():
    async with AsyncLambdaClient() as s3:
        try:
            await s3.checkpoint_durable_execution()
        except InvalidParameterValueException as e:
            print(f"Error: {e}")
            print(e.data)  # additional error data

Retrying

The SDK retries failed operations automatically. Retry behaviour follows the Smithy specification: errors are retried based on their is_retryable and is_throttling_error attributes. Throttling errors use a longer base delay. Network-level failures (connection errors and timeouts) are also retried. Non-retryable errors, such as client errors without the @retryable trait, are raised immediately without further attempts.

The number of attempts defaults to 3 and can be changed at the client level via retry_max_attempts, or per call via config_overrides.

from capo_lambda import AsyncLambdaClient


async def main():
    async with AsyncLambdaClient() as s3:
        # Default: 3 attempts for every operation
        response = await s3.checkpoint_durable_execution()

        # Override per operation
        response = await s3.checkpoint_durable_execution(config_overrides={"retry_max_attempts": 5})

        # Disable retries for this call
        response = await s3.checkpoint_durable_execution(config_overrides={"retry_max_attempts": 1})

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

capo_lambda-0.5.0.tar.gz (263.2 kB view details)

Uploaded Source

Built Distribution

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

capo_lambda-0.5.0-py3-none-any.whl (666.9 kB view details)

Uploaded Python 3

File details

Details for the file capo_lambda-0.5.0.tar.gz.

File metadata

  • Download URL: capo_lambda-0.5.0.tar.gz
  • Upload date:
  • Size: 263.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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

Hashes for capo_lambda-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ee35e172317388eb5777b1c4bc78bb2dc13881101674afdab64be8e60dba6fef
MD5 99d53e9214e565e130f122af911bf9df
BLAKE2b-256 7d3dc36a61f825110cc360c6149a969aed1b38c0ed97804f56956b0561c9150a

See more details on using hashes here.

File details

Details for the file capo_lambda-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: capo_lambda-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 666.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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

Hashes for capo_lambda-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ef30f8a946a6fc354bab68a1e7a625c268b8c3cc1ad1bc5a829fbe288ac0ab9
MD5 d58fbc19cb7a149f7e428f9823dbd3be
BLAKE2b-256 84e491e7470d36523b4730c0d1dfe9ec9d6cfc0843ffe2eaaad735c5d933c111

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