Skip to main content

Modern Python SDK for Pagar.me API v5

Project description

Pagar.me Python SDK

Python Version Ruff

Modern Python SDK for integration with the Pagar.me payment gateway (v5).

Features

  • Asynchronous: Built on httpx for high-performance async calls.
  • Type-safe: Powered by Pydantic v2 for data validation and IDE support.
  • Complete: Support for Customers, Cards, Orders, Charges, and more.

Installation

# Using uv
uv add pagarme-python-sdk

# Using pip
pip install pagarme-python-sdk

Quick Start

Asynchronous (Default)

import asyncio
from pagarme_py import PagarMeClient

async def main():
    async with PagarMeClient(api_key="sk_test_...") as client:
        # Create a customer
        customer = await client.customers.create({
            "name": "Tony Stark",
            "email": "tony@stark.com",
            "document": "12345678909",
            "type": "individual"
        })
        print(f"Created customer: {customer.id}")

if __name__ == "__main__":
    asyncio.run(main())

Synchronous

from pagarme_py import PagarMeSyncClient

def main():
    with PagarMeSyncClient(api_key="sk_test_...") as client:
        # Create a customer
        customer = client.customers.create({
            "name": "Tony Stark",
            "email": "tony@stark.com",
            "document": "12345678909",
            "type": "individual"
        })
        print(f"Created customer: {customer.id}")

if __name__ == "__main__":
    main()

Technologies

  • Python 3.13+
  • uv for package and virtual environment management
  • Pydantic v2 for data validation
  • HTTPX for asynchronous requests
  • Ruff, Pyright, isort for code quality
  • Pytest for automated tests

Development

To install development dependencies:

uv sync --all-extras

Refer to .junie/guidelines.md for contribution guidelines.

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

pagarme_python_sdk-0.2.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

pagarme_python_sdk-0.2.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file pagarme_python_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: pagarme_python_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pagarme_python_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 93ab4948dcf02e9eb7085041ea2f8d5d4cfe896df4ee64dca3ad6fbdc1577d35
MD5 dc45fb6d4a8e5a2475c5b7ec717119c8
BLAKE2b-256 4d926f2d24301cf9c59ca20cf64e7c0d5ac04edadd8d3a7fb3dfd9fbf51a28fc

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on ramon/pagarme-py

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

File details

Details for the file pagarme_python_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pagarme_python_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ace789dae5b75d34b62bca011ed57d6e2a76ffac57389fda9d8eaf3df859ed4a
MD5 ec78cdc4a74a824bc4ad6c42f8fc8e6b
BLAKE2b-256 a45d7d447f6d58c910eba3f55aff9ced33b61d06b238c71334cdf3c31dc2355b

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on ramon/pagarme-py

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