Python SDK for integration with Barte API
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file barte_python_sdk-0.12.0.tar.gz.
File metadata
- Download URL: barte_python_sdk-0.12.0.tar.gz
- Upload date:
- Size: 36.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2f5aa785e9b1e369dca412c3ed39e3dd2b2d0a38371db9b8d6b20114aa0d1b0
|
|
| MD5 |
2fb4960335fba4e344a67de2aba3bb63
|
|
| BLAKE2b-256 |
50eff233cc95c7f1aa861149b20bd967439a61b0c5ad605a3c4327d6da37a212
|
Provenance
The following attestation bundles were made for barte_python_sdk-0.12.0.tar.gz:
Publisher:
tests.yml on buserbrasil/barte-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
barte_python_sdk-0.12.0.tar.gz -
Subject digest:
b2f5aa785e9b1e369dca412c3ed39e3dd2b2d0a38371db9b8d6b20114aa0d1b0 - Sigstore transparency entry: 738061672
- Sigstore integration time:
-
Permalink:
buserbrasil/barte-python-sdk@e650a4c46761f9060d3a4c3ff54e6f8aaa6577e5 -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/buserbrasil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tests.yml@e650a4c46761f9060d3a4c3ff54e6f8aaa6577e5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file barte_python_sdk-0.12.0-py3-none-any.whl.
File metadata
- Download URL: barte_python_sdk-0.12.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83d4a5667486d63e2f551be4a2bf7627eb0d49f6f54cd7df23505ac2e9591cb8
|
|
| MD5 |
c16786bcbf547de4134fe3f315da2ac4
|
|
| BLAKE2b-256 |
2da4cffbf103d2e12ee00895316f8ea2d4c1be2b5cd617dec78927010c2b22ef
|
Provenance
The following attestation bundles were made for barte_python_sdk-0.12.0-py3-none-any.whl:
Publisher:
tests.yml on buserbrasil/barte-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
barte_python_sdk-0.12.0-py3-none-any.whl -
Subject digest:
83d4a5667486d63e2f551be4a2bf7627eb0d49f6f54cd7df23505ac2e9591cb8 - Sigstore transparency entry: 738061675
- Sigstore integration time:
-
Permalink:
buserbrasil/barte-python-sdk@e650a4c46761f9060d3a4c3ff54e6f8aaa6577e5 -
Branch / Tag:
refs/tags/v0.12.0 - Owner: https://github.com/buserbrasil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tests.yml@e650a4c46761f9060d3a4c3ff54e6f8aaa6577e5 -
Trigger Event:
push
-
Statement type: