/pywisetransfer

An unofficial, experimental Python client library for the TransferWise API

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

pywisetransfer

An unofficial, experimental Python client library for the TransferWise API.

⚠️ The classes, functions and interfaces that this library provides are very much in-development and prone to change.

Installation

# Within your project directory
pip install pywisetransfer

Usage

API Requests

import pywisetransfer

client = pywisetransfer.Client(api_key="your-api-key-here")

for profile in client.profiles.list():
    accounts = client.borderless_accounts.list(profile_id=profile.id)
    for account in accounts:
        currencies = [balance.currency for balance in account.balances]
        print(f"AccountID={account.id}, Currencies={currencies}")

Webhook signature verification

import pywisetransfer
from pywisetransfer.webhooks import verify_signature

payload = b"webhook-request-body-here"
signature = "webhook-signature-data-here"

valid = verify_signature(payload, signature)
print(f"Valid webhook signature: {valid}")

Run tests

# Within the pywisetransfer working directory
pip install .[dev]
pytest