Skip to main content

Barte Python SDK

Tests

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

Running Tests

To run the test suite, follow these steps:

  1. 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:

  1. Clone the repository:
git clone https://github.com/buser-brasil/barte-python-sdk.git
cd barte-python-sdk
  1. 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:

  1. Fork the repository
  2. Create your feature branch:
git checkout -b feature/amazing-feature
  1. Install development dependencies:
uv sync
  1. Make your changes and ensure tests pass
  2. Commit your changes:
git commit -m 'Add amazing feature'
  1. Push to the branch:
git push origin feature/amazing-feature
  1. 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)

Source distribution for barte-python-sdk 0.15.0
File Size Uploaded
barte_python_sdk-0.15.0.tar.gz 39.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for barte-python-sdk 0.15.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.15.0 This release

2 release files

0.13.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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