Barte Python SDK
A Python SDK for integrating with the Barte payment platform API. This library provides a simple and efficient way to interact with Barte's payment services, allowing you to process payments, manage transactions, and handle customer data securely.
Features
- Simple and intuitive API client
- Secure payment processing
- Card tokenization support
- Comprehensive error handling
- Type hints for better development experience
Installation
pip install barte-python-sdk
Quick Start
from barte import BarteClient
# Initialize the client
client = BarteClient(api_key="your_api_key", environment="sandbox")
# Create a card token
buyer = client.get_buyer({"documentNumber": "00011122233"})
card_token = client.create_card_token({
"holderName": "Barte Card Test",
"number": "5383638854440891",
"cvv": "220",
"expiration": "12/2025",
"buyerUuid": buyer.uuid,
})
Documentation
- OpenAPI Documentation - Complete API reference
- Integration Guide - Detailed integration guide with examples and best practices
Running Tests
To run the test suite, follow these steps:
- Run tests using pytest:
uv run pytest tests/ -v --cov=barte --cov-report=xml
Examples
You can find example implementations in the examples directory. To run the examples:
- Clone the repository:
git clone https://github.com/buser-brasil/barte-python-sdk.git
cd barte-python-sdk
- Run specific examples:
uv run examples/card_token_example.py
Make sure to set up your API credentials before running the examples.
Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Install development dependencies:
uv sync
- Make your changes and ensure tests pass
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
Development Guidelines
- Follow PEP 8 style guide
- Add tests for new features
- Update documentation as needed
- Use type hints
- Write meaningful commit messages
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or need support, please open an issue on GitHub or contact our support team.
Metadata
Release files for barte-python-sdk 0.15.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 | |
|---|---|---|---|
| barte_python_sdk-0.15.0.tar.gz | 39.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| barte_python_sdk-0.15.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.6 kB
Release files / barte_python_sdk-0.15.0.tar.gz
| Download URL | barte_python_sdk-0.15.0.tar.gz |
|---|---|
| Size | 39.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37f5acbab87b2299196128a24e6106bec8e8154191b9b8eb956521a24138e719
|
|
BLAKE2b-256 checksum How to use checksums |
377c2ee89289b47e3bdafe4e38be1f7577852130a68c06c9f806cb7f8db77fa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 28, 2026.
Transparency logRelease files / barte_python_sdk-0.15.0-py3-none-any.whl
| Download URL | barte_python_sdk-0.15.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e858263deeb22af8ac320e7b53963c0f76aaca7370c128c99fee06a696d1fe4c
|
|
BLAKE2b-256 checksum How to use checksums |
e02fedce741f00a22ff6e0b77bd81221f1871d754f249804d486818f0e066163
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 28, 2026.
Transparency log