Skip to main content

💎 Typed python client for Up's banking API

Project description

Up Bank API

Project version Supported python versions License CodeFactor Grade Monthly Downloads Total Downloads Code style

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


Download files

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

Source Distribution

up_bank_api-1.2.0.tar.gz (117.3 kB view details)

Uploaded Source

Built Distribution

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

up_bank_api-1.2.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file up_bank_api-1.2.0.tar.gz.

File metadata

  • Download URL: up_bank_api-1.2.0.tar.gz
  • Upload date:
  • Size: 117.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.4

File hashes

Hashes for up_bank_api-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e1f6be8c3843519e4999e56395ccb489e4f933d0bc46565806e037d9a8726407
MD5 e17ef51c20b820d0e81f77e63bfae1b0
BLAKE2b-256 9fac6f98ab5a8a45ea7e6c565f364619f729f76fa6e3889b2a959b1552a29f01

See more details on using hashes here.

File details

Details for the file up_bank_api-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for up_bank_api-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 627fc1cbefbef170be7c05069e85a0fbd0b39767675fa6247403492973b502ee
MD5 8643fe1e55f8286be37331859e77cb70
BLAKE2b-256 27091517ec6d95b52c71454dc80e22d2ce0fdad3bbd3af45efac425988045b81

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