parmana package behaves. If a guide and this page disagree, this page is right, and please report the guide. Every value here was read from the SDK source.
Create a client
Configuration options
Every request also carries
Content-Type: application/json and Accept: application/json. The client reuses one requests.Session, so connections are pooled.
Retries
Retries are on by default forGET requests, which is different from the TypeScript SDK, where they are off until you enable them. Set max_retries=0 to turn them off.
Errors
Every non 2xx response, and every failure to get one, is raised as a typed error. All of them extendParmanaError.
Every HTTP error has
status_code, code and request_id. The code is the SDK’s own code (for example SERVER_ERROR), not the server’s. The server’s code is preserved on server_code for CAPABILITY_NOT_ALLOWED and, from 1.1.6, on any InternalServerError.
That matters for two server errors that both arrive as InternalServerError:
From 1.1.6 read
error.server_code. On 1.1.5 and earlier server_code is not set on InternalServerError, so use status_code (503 or 500) and the message: the SIGNING_UNAVAILABLE message ends with “Nothing was executed.”, and the EXECUTION_RECORD_INCOMPLETE message says the action was released and names the businessTransactionId and the authorizationId.
Methods
The client has methods for the common calls, and a sub API for each area.
Two values are properties, not methods, so do not call them:
client.endpoint is the configured endpoint, and client.version is the version of the SDK package, for example 1.1.6. It is not the server’s version. To read the server’s version call client.execution.version(), which sends GET /version.
The sub APIs cover the rest, for example client.replay.replay(...), client.receipt.generate(...), client.receipt.get_latest(...) and client.transactions.list(...):
The full signature of every method is in the API reference.
Idempotency
businessTransactionId is the idempotency key. Sending the same one twice returns 409 (ConflictError). The helper create_business_transaction() generates the identifiers and keeps the linked ones consistent, so use it instead of writing them by hand. The SDK never retries a POST, so a single call is a single attempt.
Optional extra for offline verification
parmana.crypto (the offline Trust Record verifier) needs the cryptography package. Install it with pip install "parmana[verify]". A plain pip install parmana does not include it, and import parmana does not need it.