Skip to main content

Python library for the TransferWise API

Project description

pywisetransfer

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

:warning: 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

from flask import abort, request
from pywisetransfer.webhooks import validate_request

@app.route("/payments/wise/webhooks")
def handle_wise_webhook():
    try:
        validate_request(request)
    except Exception as e:
        logger.error(f"Wise webhook request validation failed: {e}")
        abort(400)

    ...

Run tests

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

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

pywisetransfer-0.3.0.tar.gz (17.3 kB view details)

Uploaded Source

File details

Details for the file pywisetransfer-0.3.0.tar.gz.

File metadata

  • Download URL: pywisetransfer-0.3.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pywisetransfer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9b5f5470843d78a8c3d37693b33b9f86813a9ad172877477469220364562c9d2
MD5 b5981943fa8c4c0542fef12b6341d5cf
BLAKE2b-256 b458e8cd40541e79271913c0b5b8660b5f1a20231a624fd32d4154902e4d6405

See more details on using hashes here.

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