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 | Provenance | Actions |
|---|---|---|---|---|
| pyleapo-1.0.3.tar.gz | 6.0 kB | Without provenance | Details for pyleapo-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyleapo-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for pyleapo-1.0.3-py3-none-any.whl |
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
|
Security for pyleapo 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.