From 32cb618f63fab22bd995d7a2d03f65c64a27825b Mon Sep 17 00:00:00 2001 From: peprolinbot Date: Fri, 14 Jul 2023 20:25:28 +0200 Subject: [PATCH] Add accounts example --- busGal_api/accounts/__init__.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/busGal_api/accounts/__init__.py b/busGal_api/accounts/__init__.py index 6301c7b..5e70455 100644 --- a/busGal_api/accounts/__init__.py +++ b/busGal_api/accounts/__init__.py @@ -1,3 +1,26 @@ +""" +# Introduction + +This submodule takes care of accounts and other stuff which requires logging in. This is all reverse-engineered using [mitmproxy](https://mitmproxy.org) and other techniques on the [Android app](https://play.google.com/store/apps/details?id=gal.xunta.transportepublico). + +# Quick example + +This is just a simple command-line "client" which shows your cards and makes you rename them: + +``` python +from busGal_api import accounts as api + +print("Please login to continue") +account=api.Account(input("Email: "), input("Password: ")) + +print("Here are your cards. You are going to rename each of them") +cards=account.get_cards() +for card in cards: + print(card) + card.rename(input("New name: ")) +``` +""" + from ..rest_adapter import RestAdapter as RestAdapter from ..known_servers import XG_APP as BASE_URL