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.16.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.16.0
File Size Uploaded Provenance Actions
barte_python_sdk-0.16.0.tar.gz 41.5 kB With provenance Details for barte_python_sdk-0.16.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for barte-python-sdk 0.16.0
File Interpreter ABI Platform Actions
barte_python_sdk-0.16.0-py3-none-any.whl Python 3 none any Details for barte_python_sdk-0.16.0-py3-none-any.whl

Total release size: 52.1 kB

Release files / barte_python_sdk-0.16.0.tar.gz

Download URL barte_python_sdk-0.16.0.tar.gz
Size 41.5 kB
Tags Source
SHA-256 checksum
How to use checksums
46bab2cd13b609f86e3e3973f4e4a870041cb52baf49d3d74245400e5e1f874b
BLAKE2b-256 checksum
How to use checksums
27938fb5910ddad1ffd4b68fecfe1444eeb75c4f4664cde54dc43171763c9010
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / barte_python_sdk-0.16.0-py3-none-any.whl

Download URL barte_python_sdk-0.16.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8101f73c07c4536c15ab4a0ca74ec5331e09ce7df28fe1f179463de12add05f6
BLAKE2b-256 checksum
How to use checksums
5f32396c4f388848f4559971fd77de26519cd929c07b06e78659960b3df6efee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Security for barte-python-sdk 0.16.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.

Select from 2 files

Attestation for barte_python_sdk-0.16.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 Oct 14, 2026.

Transparency log

A 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.

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