{"id":18263838,"url":"https://github.com/eidorb/ubank","last_synced_at":"2025-09-09T06:08:01.239Z","repository":{"id":22118172,"uuid":"25448750","full_name":"eidorb/ubank","owner":"eidorb","description":"Access ubank.com.au using Python","archived":false,"fork":false,"pushed_at":"2025-05-30T11:02:44.000Z","size":957,"stargazers_count":23,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-30T13:16:59.783Z","etag":null,"topics":["banking","http-client","meatie","python"],"latest_commit_sha":null,"homepage":"https://eidorb.github.io/ubank/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"screepers/screeps-typescript-profiler","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eidorb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-10-20T03:10:23.000Z","updated_at":"2025-05-30T11:02:47.000Z","dependencies_parsed_at":"2024-02-03T01:27:12.496Z","dependency_job_id":"27bd75cf-dbb4-4869-bb84-9bd0f67edda2","html_url":"https://github.com/eidorb/ubank","commit_stats":null,"previous_names":["eidorb/ubank"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/eidorb/ubank","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidorb%2Fubank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidorb%2Fubank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidorb%2Fubank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidorb%2Fubank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eidorb","download_url":"https://codeload.github.com/eidorb/ubank/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eidorb%2Fubank/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260535866,"owners_count":23024253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banking","http-client","meatie","python"],"created_at":"2024-11-05T11:12:52.986Z","updated_at":"2025-09-09T06:08:01.225Z","avatar_url":"https://github.com/eidorb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ubank\n\nAccess [ubank](https://www.ubank.com.au)'s API using Python.\n\n\n## Getting started\n\nInstall ubank using pip:\n\n    pip install ubank\n\nThe ubank package provides a script to register a new passkey with ubank:\n\n```console\n$ ubank name@domain.com --output passkey.txt\nEnter ubank password:\nEnter security code sent to 04xxxxx789: 123456\n```\n\nThis saves a new passkey to `passkey.txt` (encrypted with your ubank password).\nYou'll be prompted for your ubank username and SMS security code interactively.\n\n\u003e [!CAUTION]\n\u003e Your passkey grants access to your bank account.\n\u003e It is **your** responsibility to keep it safe!\n\nCreate a script named `balances.py`:\n\n```python\nfrom getpass import getpass\n\nfrom ubank import Client, Passkey\n\n# Load passkey from file.\nwith open(\"passkey.txt\", \"rb\") as f:\n    passkey = Passkey.load(f, password=getpass(\"Enter ubank password: \"))\n\n# Print account balances.\nwith Client(passkey) as client:\n    for account in client.get_linked_banks().linkedBanks[0].accounts:\n        print(\n            f\"{account.label} ({account.type}): {account.balance.available} {account.balance.currency}\"\n        )\n```\n\nRun the script to print your account balances:\n\n```console\n$ python balances.py\nEnter ubank password:\nSpend account (TRANSACTION): 765.48 AUD\nSavings account (SAVINGS): 1577.17 AUD\n```\n\n\n## Contents\n\n- [Getting started](#getting-started)\n- [Contents](#contents)\n- [ubank CLI](#ubank-cli)\n- [ubank API client](#ubank-api-client)\n- [Example web application](#example-web-application)\n- [How to set up a development environment](#how-to-set-up-a-development-environment)\n- [How to test](#how-to-test)\n- [How to publish a new release](#how-to-publish-a-new-release)\n- [Changelog](#changelog)\n\n\n## ubank CLI\n\nThe `ubank` module provides a CLI for registering a new passkey:\n\n```console\n$ ubank --help\nusage: ubank [-h] [-o FILE] [-n PASSKEY_NAME] [-v] username\n\nReturns a new passkey registered with ubank.\n\npositional arguments:\n  username              ubank username\n\noptions:\n  -h, --help            show this help message and exit\n  -o, --output FILE     writes encrypted passkey to file (default: write to stdout)\n  -n, --passkey-name PASSKEY_NAME\n                        sets passkey name (default: ubank.py)\n  -v, --verbose         displays httpx INFO logs\n\nYou will be asked for your ubank password and secret code interactively. The passkey is encrypted with your ubank password.\n```\n\n\n## ubank API client\n\nCreate an instance of `ubank.Client` to access ubank's API:\n\n```python\nfrom datetime import date\nfrom getpass import getpass\n\nfrom ubank import Client, Filter, Passkey\n\nwith open(\"passkey.txt\", \"rb\") as f:\n    passkey = Passkey.load(f, password=getpass(\"Enter ubank password: \"))\n\nwith Client(passkey) as client:\n    client.summarise_transactions(\n        body=Filter(fromDate=date(2025, 1, 1), toDate=date(2025, 2, 1))\n    )\n    bank = client.get_linked_banks().linkedBanks[0]\n    client.search_account_transactions(\n        account_id=bank.accounts[0].id,\n        bank_id=bank.bankId,\n        customerId=client.get_customer_details().customerId,\n    )\n    client.get_cards()\n    client.get_devices(deviceUuid=passkey.device_id)\n    client.get_contacts()\n```\n\n\n## Example web application\n\n`notebook.py` is a [marimo notebook](https://eidorb.github.io/ubank/notebook.html).\nIt demonstrates usage of the API client class to explore ubank's API.\n\nOpen `notebook.py` in the marimo editor:\n\n    uv run marimo edit notebook.py\n\nRun the notebook as a web application:\n\n    uv run marimo edit notebook.py\n\n![](notebook.gif)\n\n\n## How to set up a development environment\n\nInstall [uv](https://docs.astral.sh/uv/):\n\n    curl -LsSf https://astral.sh/uv/install.sh | sh\n\nClone this repository:\n\n    git clone git@github.com:eidorb/ubank.git\n    cd ubank\n\nuv ensures Python dependencies compatible with those defined in [`pyproject.toml`](pyproject.toml)\nare automatically installed:\n\n```console\n$ uv run python -c 'import ubank; print(ubank.__version__)'\nUsing CPython 3.13.2 interpreter at: /opt/homebrew/opt/python@3.13/bin/python3.13\nCreating virtual environment at: .venv\nInstalled 17 packages in 22ms\n2.0.0\n```\n\n\n## How to test\n\nRun all tests:\n\n    uv run -m pytest -v\n\n\n## How to publish a new release\n\nBump project version with [hatch](https://hatch.pypa.io/latest/version/):\n\n```console\n$ uvx hatch version release\nOld: 2.0.0rc2\nNew: 2.0.0\n```\n\nUpdate `test_version` test.\n\nCreate version tag and push to GitHub:\n\n    git tag \"v$(uvx hatch version)\"\n    git push origin \"v$(uvx hatch version)\"\n\nOpen new release form for tag:\n\n    open \"https://github.com/eidorb/ubank/releases/new?tag=v$(uvx hatch version)\"\n\nPublishing a release triggers this [workflow](.github/workflows/workflow.yml)\nwhich builds and publishes the package to [PyPI](https://pypi.org/project/ubank/).\n\nIf you screw up -- delete local and remote tags and have another go:\n\n    git tag -d \"v$(uvx hatch version)\"\n    git push origin --delete \"v$(uvx hatch version)\"\n\n\n## Changelog\n\n##### 2.2.4\n\n- Generate `x-device-meta` with dynamic versions (thanks [@gdarby70](https://github.com/eidorb/ubank/issues/9)!)\n\n\n##### 2.2.3\n\n- Define additional Filter fields (thanks [@CactiNotch](https://github.com/eidorb/ubank/pull/8)!)\n\n\n##### 2.2.2\n\n- Fix potentially optional Transaction fields (thanks [@CactiNotch](https://github.com/eidorb/ubank/issues/7)!)\n\n\n##### 2.2.1\n\n- `get_linked_banks()` returns linked external bank accounts (thanks [@CactiNotch](https://github.com/eidorb/ubank/issues/7)!)\n\n\n#### 2.2.0\n\n- Rework API method and model names to have more meaning\n\n\n#### 2.1.0\n\n- Passkey encrypted with ubank password\n- Add API client `Api`\n- Add marimo notebook\n\n\n### 2.0.0\n\n- Implement passkey registration and authentication (fixes [#6](https://github.com/eidorb/ubank/issues/6)).\n- Automate releases.\n- Support Python 3.9+.\n- Migrate from Poetry to uv.\n\n\n#### 1.1.0\n\n- Set `x-api-version` to fix [#4](https://github.com/eidorb/ubank/issues/4) (thanks [@jakepronger](https://github.com/eidorb/ubank/pull/5)!)\n\n\n### 1.0.0\n\n- Drop Playwright requirement.\n- Re-implement with simpler and lightweight [httpx](https://www.python-httpx.org) libary.\n- Easier access to full ubank API.\n\n\n### 0.1.2\n\n- Automate ubank access using [Playwright](https://playwright.dev) headless browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidorb%2Fubank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feidorb%2Fubank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidorb%2Fubank/lists"}