Skip to content
module.py 1.68 KiB
Newer Older
Cédric Félizard's avatar
Cédric Félizard committed
# -*- coding: utf-8 -*-

# Copyright(C) 2015 Cédric Félizard
#
Roger Philibert's avatar
Roger Philibert committed
# This file is part of a woob module.
Cédric Félizard's avatar
Cédric Félizard committed
#
Roger Philibert's avatar
Roger Philibert committed
# This woob module is free software: you can redistribute it and/or modify
Cédric Félizard's avatar
Cédric Félizard committed
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
Roger Philibert's avatar
Roger Philibert committed
# This woob module is distributed in the hope that it will be useful,
Cédric Félizard's avatar
Cédric Félizard committed
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
Roger Philibert's avatar
Roger Philibert committed
# along with this woob module. If not, see <http://www.gnu.org/licenses/>.
Cédric Félizard's avatar
Cédric Félizard committed


from woob.capabilities.bank import CapBank
from woob.tools.backend import Module, BackendConfig
from woob.tools.value import ValueBackendPassword
Cédric Félizard's avatar
Cédric Félizard committed
from .browser import Kiwibank


__all__ = ['KiwibankModule']


class KiwibankModule(Module, CapBank):
    NAME = 'kiwibank'
    MAINTAINER = u'Cédric Félizard'
    EMAIL = 'cedric@felizard.fr'
Romain Bignon's avatar
Romain Bignon committed
    VERSION = '3.6'
Cédric Félizard's avatar
Cédric Félizard committed
    LICENSE = 'AGPLv3+'
    DESCRIPTION = u'Kiwibank'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Access number', masked=False),
Cédric Félizard's avatar
Cédric Félizard committed
        ValueBackendPassword('password', label='Password'),
    )
    BROWSER = Kiwibank

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(), self.config['password'].get())
Cédric Félizard's avatar
Cédric Félizard committed

    def iter_accounts(self):
        return self.browser.get_accounts()

    def iter_history(self, account):
        for transaction in self.browser.get_history(account):
            yield transaction