Skip to main content

A Python API for accessing your Leap Card balance, overview, and travel credit history.

Project description

pyleapo

PyPI

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': '...'
    },
    ...
  ]
}

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

pyleapo-1.0.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

pyleapo-1.0.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pyleapo-1.0.3.tar.gz.

File metadata

  • Download URL: pyleapo-1.0.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyleapo-1.0.3.tar.gz
Algorithm Hash digest
SHA256 703b6ed2fef557eb87d8754a2317085f3ce56449d16af3698a190b3e5d670272
MD5 e116d3463f301a72c2d87eca36d651cd
BLAKE2b-256 38f162c1bf25a51dfd154107895a0623d7157c5b6f18666db0fd8d50b6469b5a

See more details on using hashes here.

File details

Details for the file pyleapo-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyleapo-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyleapo-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea48a3d22d22a7ea1739e7c8d03b387a4a92cac0646e2724cf09accbac8595a0
MD5 5a00e10105b06d6e53250b649b98c17c
BLAKE2b-256 2c8dbac0770637e881d78c9d39483360fd75620a7952e147fce8fcf0d45077d0

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