ovchipcardlib package

Submodules

ovchipcardlib.helpers module

Helper Modules

class ovchipcardlib.helpers.Card(service_instance, data)[source]

Bases: object

Model of the card object

alias
auto_reloading
balance
balance_datetime
default
expiry_datetime
get_latest_transactions()[source]

Gets the latest transactions

Returns transactions happening after the last time this was called and clears itself upon conclusion. Can be used to monitor the live transactions on the card.

Returns:A list of transaction objects.
number
status
status_announcement
static timestamp_to_datetime(timestamp)[source]
transactions

Presents the transactions of the card

Returns:A list of transaction objects.
type
class ovchipcardlib.helpers.Token(access, expires_in, id, refresh, scope, type)

Bases: tuple

access

Alias for field number 0

expires_in

Alias for field number 1

id

Alias for field number 2

refresh

Alias for field number 3

scope

Alias for field number 4

type

Alias for field number 5

class ovchipcardlib.helpers.Transaction(data)[source]

Bases: object

check_in_info
check_in_text
company
datetime
e_purse_mut
e_purse_mut_info
explanation
fare
fare_calculation
fare_text
name
priority
product_info
product_text
station
type

ovchipcardlib.ovchipcardlib module

Main module file

Service class implemented here

class ovchipcardlib.ovchipcardlib.Service(username, password)[source]

Bases: object

Object representing the ov chip card service.

Can authenticate with the appropriate credentials and retrieves cards from the remote service.

authorization_token

The authorization token

Returns:The string of the authentication token
Return type:auth_token (str)
cards

Retrieves the cards and instantiates the Card objects

Returns:A list of card objects
Return type:cards (list)
get_card_by_alias(alias)[source]

Returns a card object by alias

Parameters:alias (str) – The alias of the card to look for
Returns:A card object if a match found or None

ovchipcardlib.ovchipcardlibexceptions module

Exceptions module

exception ovchipcardlib.ovchipcardlibexceptions.BrokenResponse[source]

Bases: exceptions.Exception

Server did not respond as expected

exception ovchipcardlib.ovchipcardlibexceptions.UnAuthorized[source]

Bases: exceptions.Exception

Could not verify authorization token.

exception ovchipcardlib.ovchipcardlibexceptions.UnableToRetrieveToken[source]

Bases: exceptions.Exception

The retrieval of the token failed.

Module contents

ovchipcardlib package

Imports all parts from ovchipcardlib here