Skip to main content

Python SDK for integration with Barte API

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

barte_python_sdk-0.13.0.tar.gz (38.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

barte_python_sdk-0.13.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file barte_python_sdk-0.13.0.tar.gz.

File metadata

  • Download URL: barte_python_sdk-0.13.0.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for barte_python_sdk-0.13.0.tar.gz
Algorithm Hash digest
SHA256 9d4c68a060d3c74dc5a3ee1ddca761dd4bb2b797ab94873ee096e9a6050c3161
MD5 fba919e4de51ca644e2ba17ac8b3e159
BLAKE2b-256 b9c0b88e7fcf833595b00b7f5938910223688d21721c79859330bd1dfe8ee64c

See more details on using hashes here.

Provenance

The following attestation bundles were made for barte_python_sdk-0.13.0.tar.gz:

Publisher: tests.yml on buserbrasil/barte-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file barte_python_sdk-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for barte_python_sdk-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee95ca065807727aeda44fe5d0731cf1604b8fbea41dbcf634def47ed1d9b322
MD5 5918b1b6230ebafcc17bac29f739ee7c
BLAKE2b-256 7e71db10c27ad34636516bdf1eed6b805498853592275fe5ca1661bc1fb6a36e

See more details on using hashes here.

Provenance

The following attestation bundles were made for barte_python_sdk-0.13.0-py3-none-any.whl:

Publisher: tests.yml on buserbrasil/barte-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page