💎 Fully typed Python client for (a)sync interaction with Up's banking API
Project description
Up Bank API
This is an unofficial Python API wrapper for the Australian Bank Up's API.
This package is fully typed, documented, and it has an intuitive structure, so I'd recommend just having quick look at the docs, and letting syntax completion take the wheel.
Installation
pip install up-bank-api
To include async support
pip install up-bank-api[async]
Usage
To use this library you will need a personal access token which can be retrieved from https://developer.up.com.au. When using this library you can either provide the token directly or use the environment variable UP_TOKEN
.
Synchronous Client
from upbankapi import Client, NotAuthorizedException
# implicitly use the environment variable UP_TOKEN
client = Client()
# or directly provide token
client = Client(token="MY_TOKEN")
# check the token is valid
try:
user_id = client.ping()
print(f"Authorized: {user_id}")
except NotAuthorizedException:
print("The token is invalid")
Asynchronous Client
import asyncio
from upbankapi import AsyncClient, NotAuthorizedException
async def main():
# implicitly use the environment variable UP_TOKEN
client = AsyncClient()
# or directly provide token
client = AsyncClient(token="MY_TOKEN")
# use a context manager to automatically close the aiohttp session
async with AsyncClient() as client:
try:
user_id = await client.ping()
print(f"Authorized: {user_id}")
except NotAuthorizedException:
print("The token is invalid")
if __name__ == "__main__":
asyncio.run(main())
See the docs for more information, examples and code reference.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for up_bank_api-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78d10327824745dcf61628a2b11a99d71a3072308df649b4209bfd1df7bd6adf |
|
MD5 | 8ec6e733cab1a706e4abd5e475e98848 |
|
BLAKE2b-256 | 665a7cfc9e1fd148bb57beda78a87d67be16214d5e68d624be8c0763fe08cfbc |