Skip to main content

Raims Python

Official Python SDK for the Raims public API.

Use the SDK in server applications, with synchronous and asynchronous clients, typed parameters, read-only responses, cursor pagination, and webhook signature verification.

Install

Requires Python 3.10 or later. In your application's virtual environment:

python -m pip install raims

The package and import name are both raims. It uses HTTPX for HTTP transport.

To update to the current stable version:

python -m pip install --upgrade raims

Read the release notes and test your integration after updating. Pin the SDK and its dependencies in your application's dependency configuration to reproduce installations. Future updates are not applied automatically.

GitHub releases also provide wheel and source archives. Verify the downloaded file with SHA256SUMS before installing it. Install the downloaded wheel in your application environment:

python -m pip install /path/to/downloaded-package.whl

First request

import os

from raims import RaimsClient

with RaimsClient(os.environ["RAIMS_API_KEY"]) as raims:
    page = raims.customers.list({"page_size": 20})
    for customer in page:
        process_customer(customer.id)

process_customer represents your application's processing. The base URL is https://api.raims.com for both Sandbox and Production. The key determines the company, environment, and permissions. Keep it on the server and out of version control.

Create a charge

customer_id, due_date, and order_idempotency_key are values your application has already defined and persisted for the order. The due date uses Unix seconds in UTC, and the amount uses integer cents: 15000 represents BRL 150.00.

from raims import RequestOptions

with RaimsClient(os.environ["RAIMS_API_KEY"]) as raims:
    charge = raims.charges.create(
        {
            "customer_id": customer_id,
            "amount_cents": 15000,
            "due_date": due_date,
            "title": "Order 1234",
        },
        options=RequestOptions(idempotency_key=order_idempotency_key),
    )
    response = charge.last_response
    assert response is not None
    request_id = response.request_id

The SDK does not generate idempotency keys or retry writes automatically. If you lose a response, keep the same key and parameters and follow the endpoint's rules for retrieving or retrying the operation. A 202 response means processing is pending; retrieve the resource to follow its outcome.

Asynchronous use

from raims import AsyncRaimsClient

async def load_customers(api_key: str) -> None:
    async with AsyncRaimsClient(api_key) as raims:
        page = await raims.customers.list({"page_size": 50})
        async for customer in page.auto_paging_iter():
            await process_customer_async(customer.id)

process_customer_async represents your application's asynchronous processing. Normal iteration over a page accesses only the items already received. auto_paging_iter() retrieves subsequent pages as you consume them.

Services

Property Resources
accounts Account context, number, fees, and checkout
balances Balance and forecast
customers Customer creation, retrieval, and deletion
charges Charges, payment, documents, and refunds for a charge
payment_links Payment links and email delivery requests
refunds Refunds and receipts
disputes Disputes
statements Account statements
withdrawals Withdrawals, limits, summary, and automatic settings
withdrawal_destinations Withdrawal destinations
webhooks Registration, health, pause, test, and secret rotation
webhook_event_types Available event types
simulations.charges Charge simulations with a Sandbox key
simulations.refunds Refund simulations with a Sandbox key

Services expose create, retrieve, update, delete, and list according to the operations available. The reference describes each method.

Documentation

Distributed under the MIT license.

Metadata

Release files for raims 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for raims 0.1.3
File Size Uploaded Provenance Actions
raims-0.1.3.tar.gz 223.9 kB Without provenance Details for raims-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for raims 0.1.3
File Interpreter ABI Platform Actions
raims-0.1.3-py3-none-any.whl Python 3 none any Details for raims-0.1.3-py3-none-any.whl

Total release size: 265.8 kB

Release files / raims-0.1.3.tar.gz

Download URL raims-0.1.3.tar.gz
Size 223.9 kB
Tags Source
SHA-256 checksum
How to use checksums
682a6f6cf5aeefb444b8c23630e438f84db00a2e1c077fc16ce3c5c2fbe0eaca
BLAKE2b-256 checksum
How to use checksums
c6e7a42fddea05ade040072b98e05ead7c90320e3d80f6ba36d684076d075f3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / raims-0.1.3-py3-none-any.whl

Download URL raims-0.1.3-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
600875c38d864d63e5f120ef7a2196069311572178b18052c99eb8b464217a53
BLAKE2b-256 checksum
How to use checksums
eca0a1025d2643b8c412423dc0996ad0a4c9f0ffb2f1f4cfd3fc8f7593a52bd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Security for raims 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page