For more control on the weboob use, it can be used as a Python library.

A Weboob instance is used to load backends implementing a capability (as a command like boobank does). It's also used to query the weboob modules. A backend is simply an instance of a class implementing a capability.

To load backends implementing CapBank:

from weboob.core import Weboob
from weboob.capabilities.bank import CapBank

w = Weboob()
w.load_backends(CapBank)

It's then possible to query a particular backend directly, for example the iter_accounts method will return Account instances:

total = 0
for acc in w['bnporc'].iter_accounts():
    total += acc.balance
print('Total for bnporc:', balance)

It's also possible to aggregate from all backends:

total = 0
for acc in w.iter_accounts():
    total += acc.balance
print('Total for all backends:', balance)