Skip to main content

Python installation

Requirements​

  • Python 3.10 or later.
  • The SDK depends on httpx, installed automatically.

Install​

pip install cargo-core-api-sdk

or, with uv:

uv add cargo-core-api-sdk

Configure​

import os
from cargo_core_api_sdk import CargoClient

client = CargoClient(api_key=os.environ["CARGO_API_KEY"], environment="dev")
ArgumentTypeDefaultDescription
api_keystrrequiredYour user-token.
environment"dev", "co", "mx", "ar", "uy", "br", "cl", "cr", "ec", "pe""dev"Which gateway to call. See Environments.
base_urlstrresolved from environmentOverrides the base URL, e.g. for a proxy.
timeoutfloat15.0Request timeout in seconds.

Close the client​

CargoClient keeps an HTTP connection pool. Use it as a context manager so it is closed for you:

with CargoClient(api_key=os.environ["CARGO_API_KEY"], environment="dev") as client:
groups = client.authorization.list_permission_groups()

or call client.close() yourself when you are done.

Next: Quickstart.