Metadata-Version: 2.4
Name: pagarme-python-sdk
Version: 0.2.0
Summary: Modern Python SDK for Pagar.me API v5
Project-URL: Homepage, https://github.com/ramon/pagarme-py
Project-URL: Repository, https://github.com/ramon/pagarme-py
Project-URL: Issues, https://github.com/ramon/pagarme-py/issues
Project-URL: Documentation, https://docs.pagar.me/
Author-email: Ramon Soares <eu@ramonsoares.com>
License-File: LICENSE
Keywords: api,fintech,gateway,pagarme,payments,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.13
Requires-Dist: httpx>=0.24.0
Requires-Dist: pydantic[email]>=2.0
Provides-Extra: dev
Requires-Dist: isort>=5.13.0; extra == 'dev'
Requires-Dist: pyright>=1.1.350; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Description-Content-Type: text/markdown

# Pagar.me Python SDK

[![Python Version](https://img.shields.io/badge/python-3.14-blue.svg)](https://www.python.org/downloads/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/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

```bash
# Using uv
uv add pagarme-python-sdk

# Using pip
pip install pagarme-python-sdk
```

## Quick Start

### Asynchronous (Default)

```python
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

```python
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:

```bash
uv sync --all-extras
```

Refer to [.junie/guidelines.md](.junie/guidelines.md) for contribution guidelines.
