Skip to main content

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.

Metadata

Release files for pagarme-python-sdk 0.2.0

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

Source distribution (sdist)

Source distribution for pagarme-python-sdk 0.2.0
File Size Uploaded Provenance Actions
pagarme_python_sdk-0.2.0.tar.gz 27.9 kB With provenance Details for pagarme_python_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pagarme-python-sdk 0.2.0
File Interpreter ABI Platform Actions
pagarme_python_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for pagarme_python_sdk-0.2.0-py3-none-any.whl

Total release size: 42.4 kB

Release files / pagarme_python_sdk-0.2.0.tar.gz

Download URL pagarme_python_sdk-0.2.0.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
93ab4948dcf02e9eb7085041ea2f8d5d4cfe896df4ee64dca3ad6fbdc1577d35
BLAKE2b-256 checksum
How to use checksums
4d926f2d24301cf9c59ca20cf64e7c0d5ac04edadd8d3a7fb3dfd9fbf51a28fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.

Transparency log

Release files / pagarme_python_sdk-0.2.0-py3-none-any.whl

Download URL pagarme_python_sdk-0.2.0-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ace789dae5b75d34b62bca011ed57d6e2a76ffac57389fda9d8eaf3df859ed4a
BLAKE2b-256 checksum
How to use checksums
a45d7d447f6d58c910eba3f55aff9ced33b61d06b238c71334cdf3c31dc2355b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.

Transparency log

Security for pagarme-python-sdk 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pagarme_python_sdk-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.

Transparency log

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.

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