Metadata-Version: 2.1
Name: pywisetransfer
Version: 0.3.1
Summary: Python library for the TransferWise API
Home-page: https://www.github.com/jayaddison/pywisetransfer
License: AGPL-3.0
Keywords: payments,transferwise
Author: James Addison
Author-email: jay@jp-hosting.net
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Provides-Extra: dev
Requires-Dist: apiron (>=7.1.0,<8.0.0)
Requires-Dist: black (>=23.12.1,<24.0.0) ; extra == "dev"
Requires-Dist: cryptography (<42.0.0)
Requires-Dist: munch (>=4.0.0,<5.0.0)
Requires-Dist: munch-stubs (>=0.1.2,<0.2.0) ; extra == "dev"
Requires-Dist: pytest (>=7.0.1,<8.0.0) ; extra == "dev"
Requires-Dist: responses (>=0.24.1,<0.25.0) ; extra == "dev"
Requires-Dist: types-cryptography (>=3.3.23.2,<4.0.0.0) ; extra == "dev"
Project-URL: Repository, https://www.github.com/jayaddison/pywisetransfer
Description-Content-Type: text/markdown

# pywisetransfer

An unofficial, experimental Python client library for the [TransferWise API](https://api-docs.transferwise.com).

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

## Installation

```bash
# Within your project directory
pip install pywisetransfer
```

## Usage

### API Requests

```python
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

```python
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

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

