Skip to content

Instantly share code, notes, and snippets.

@elohmeier
Created February 11, 2017 16:33
Show Gist options
  • Save elohmeier/e12fec18d975575f7431587946e1373b to your computer and use it in GitHub Desktop.
Save elohmeier/e12fec18d975575f7431587946e1373b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import aqbanking
def callback(domain, prio, msg):
print('[LOG]: %r' % (msg,))
def password_cb(flags, token, title, text, minLen, maxLen):
# we'll get something like:
# Password: 0 / PIN_<bank code>_<User> / PIN-Eingabe / Bitte geben Sie die PIN für
# Benutzer 000000000 bei <Bank>
# ein.<html>Bitte geben Sie die PIN für Benutzer <i>[user]</i> bei <i>[bank name]</i> ein.<br></html> / 4 / 64
#print('Password: %s / %s / %s / %s / %s\n' % (str(flags), token, title, str(minLen), str(maxLen)))
return 'PIN_**BLZ**_**USERNAME**=**PIN**'
acc = aqbanking.listacc()[0]
acc.set_callbackLog(callback)
acc.set_callbackPassword(password_cb)
ret = acc.balance()
if ret is not None:
try:
print(ret[0])
except TypeError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment