pyleapo
An unoffical Python API for accessing your Leap Card balance, overview, and travel credit history. Underneath the hood, pyleapo uses Scrapy to retrieve its data and therefore brings you an additional suite of options to utilise further if necessary.
Requirements
- Python 3.5.2+
Installation
Simply:
pip install pyleapo
Usage
There are three modules to choose from, the samples below showcase each of them one by one.
1. Card Overview
Retrieves a card's overview information such as the current balance and more.
Code
from pyleapo.overview import get_card_overview
overview = get_card_overview(username='', password='')
print(overview)
Output
{
'auto_topup': '...',
'card_expiry_date': '...',
'card_issue_date': '...',
'card_label': '...',
'card_number': '...',
'card_status': '...',
'card_type': '...',
'travel_credit_balance': '...',
'travel_credit_status': '...'
}
2. Card History
Retrieves a card's travel credit history as far as it goes back.
Code
from pyleapo.history import get_card_history
history = get_card_history(username='', password='')
print(history)
Output
[
{
'amount': '...',
'balance': '...',
'date': '...',
'source': '...',
'time': '...',
'transaction_type': '...'
},
...
]
3. Card Overview and History
Retrieves both the overview and history of a card all in one.
Code
from pyleapo.aio import get_card_overview_and_history
both = get_card_overview_and_history(username='', password='')
print(both)
Output
{
'overview': {
'auto_topup': '...',
'card_expiry_date': '...',
'card_issue_date': '...',
'card_label': '...',
'card_number': '...',
'card_status': '...',
'card_type': '...',
'travel_credit_balance': '...',
'travel_credit_status': '...'
},
'events': [
{
'amount': '...',
'balance': '...',
'date': '...',
'source': '...',
'time': '...',
'transaction_type': '...'
},
...
]
}
Metadata
Release files for pyleapo 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyleapo-1.0.3.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyleapo-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.0 kB
Release files / pyleapo-1.0.3.tar.gz
| Download URL | pyleapo-1.0.3.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
703b6ed2fef557eb87d8754a2317085f3ce56449d16af3698a190b3e5d670272
|
|
BLAKE2b-256 checksum How to use checksums |
38f162c1bf25a51dfd154107895a0623d7157c5b6f18666db0fd8d50b6469b5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|
Release files / pyleapo-1.0.3-py3-none-any.whl
| Download URL | pyleapo-1.0.3-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea48a3d22d22a7ea1739e7c8d03b387a4a92cac0646e2724cf09accbac8595a0
|
|
BLAKE2b-256 checksum How to use checksums |
2c8dbac0770637e881d78c9d39483360fd75620a7952e147fce8fcf0d45077d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|