Pagar.me Python SDK
Modern Python SDK for integration with the Pagar.me payment gateway (v5).
Features
- Asynchronous: Built on
httpxfor high-performance async calls. - Type-safe: Powered by
Pydantic v2for 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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.