Ejemplo n.º 1
0
class AXABanqueModule(Module, CapBank):
    NAME = 'axabanque'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '1.3'
    DESCRIPTION = u'AXA Banque'
    LICENSE = 'AGPLv3+'
    CONFIG = BackendConfig(ValueBackendPassword('login',    label='Identifiant', masked=False),
                           ValueBackendPassword('password', label='Code', regexp='\d+'))
    BROWSER = AXABanque

    def create_default_browser(self):
        login = self.config['login'].get()
        self.BROWSER = AXABanque if login.isdigit() else AXAAssurance
        return self.create_browser(login, self.config['password'].get())

    def get_account(self, _id):
        return find_object(self.browser.iter_accounts(), id=_id, error=AccountNotFound)

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

    def iter_investment(self, account):
        return self.browser.iter_investment(account)

    def iter_history(self, account):
        return self.browser.iter_history(account)
Ejemplo n.º 2
0
class KiwibankModule(Module, CapBank):
    NAME = 'kiwibank'
    MAINTAINER = u'Cédric Félizard'
    EMAIL = '*****@*****.**'
    VERSION = '2.1'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = u'Kiwibank'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Access number', masked=False),
        ValueBackendPassword('password', label='Password'),
    )
    BROWSER = Kiwibank

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(), self.config['password'].get())

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

    def get_account(self, _id):
        return find_object(self.browser.get_accounts(), id=_id, error=AccountNotFound)

    def iter_history(self, account):
        for transaction in self.browser.get_history(account):
            yield transaction
Ejemplo n.º 3
0
class OneyModule(Module, CapBank):
    NAME = 'oney'
    MAINTAINER = u'Vincent Paredes'
    EMAIL = '*****@*****.**'
    VERSION = '1.4'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = 'Oney'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Mot de passe'))
    BROWSER = OneyBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

    def iter_accounts(self):
        for account in self.browser.get_accounts_list():
            yield account

    def get_account(self, _id):
        return find_object(self.browser.get_accounts_list(),
                           id=_id,
                           error=AccountNotFound)

    def iter_history(self, account):
        # To prevent issues in calcul of actual balance and coming one, all
        # operations are marked as debited.
        for tr in self.browser.iter_coming(account):
            yield tr

        for tr in self.browser.iter_history(account):
            yield tr
Ejemplo n.º 4
0
class PaypalModule(Module, CapBank):
    NAME = 'paypal'
    MAINTAINER = u'Laurent Bachelier'
    EMAIL = '*****@*****.**'
    VERSION = '1.2'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = u'PayPal'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='E-mail', masked=False),
        ValueBackendPassword('password', label='Password'))
    BROWSER = Paypal

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        account = self.browser.get_account(_id)
        if account:
            return account
        else:
            raise AccountNotFound()

    def iter_history(self, account):
        for history in self.browser.get_download_history(account):
            yield history
Ejemplo n.º 5
0
class BanqueAccordModule(Module, CapBank):
    NAME = 'banqueaccord'
    DESCRIPTION = u'Banque Accord'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    LICENSE = 'AGPLv3+'
    VERSION = '1.1'
    CONFIG = BackendConfig(
        ValueBackendPassword('login',
                             label='Identifiant',
                             regexp='\d+',
                             masked=False),
        ValueBackendPassword('password', label=u"Code d'accès", regexp='\d+'))

    BROWSER = BanqueAccordBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        return find_object(self.browser.get_accounts_list(),
                           id=_id,
                           error=AccountNotFound)

    def iter_history(self, account):
        return self.browser.iter_history(account)
Ejemplo n.º 6
0
class BoursoramaModule(Module, CapBankTransferAddRecipient, CapProfile, CapContact):
    NAME = 'boursorama'
    MAINTAINER = u'Gabriel Kerneis'
    EMAIL = '*****@*****.**'
    VERSION = '1.3'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = u'Boursorama'
    CONFIG = BackendConfig(ValueBackendPassword('login',      label='Identifiant', masked=False),
                           ValueBackendPassword('password',   label='Mot de passe'),
                           ValueBool('enable_twofactors',     label='Send validation sms', default=False),
                           Value('device',                    label='Device name', regexp='\w*', default=''),
                           Value('pin_code',                  label='Sms code', required=False),
                          )
    BROWSER = BoursoramaBrowser

    def create_default_browser(self):
        return self.create_browser(self.config)

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

    def get_account(self, _id):
        account = self.browser.get_account(_id)
        if account:
            return account
        else:
            raise AccountNotFound()

    def iter_history(self, account):
        for tr in self.browser.get_history(account):
            if not tr._is_coming:
                yield tr

    def iter_coming(self, account):
        for tr in self.browser.get_history(account, coming=True):
            if tr._is_coming:
                yield tr

    def iter_investment(self, account):
        return self.browser.get_investment(account)

    def get_profile(self):
        return self.browser.get_profile()

    def iter_contacts(self):
        return self.browser.get_advisor()

    def iter_transfer_recipients(self, account):
        if not isinstance(account, Account):
            account = self.get_account(account)
        return self.browser.iter_transfer_recipients(account)

    def init_transfer(self, transfer, **kwargs):
        return self.browser.init_transfer(transfer, **kwargs)

    def new_recipient(self, recipient, **kwargs):
        return self.browser.new_recipient(recipient, **kwargs)

    def execute_transfer(self, transfer, **kwargs):
        return self.browser.execute_transfer(transfer, **kwargs)
Ejemplo n.º 7
0
class CaisseEpargneBackend(BaseBackend, ICapBank):
    NAME = 'caissedepargne'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '0.e'
    DESCRIPTION = u'Caisse d\'Épargne French bank website'
    LICENSE = 'AGPLv3+'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Account ID', masked=False),
        ValueBackendPassword('password', label='Password', regexp='\d+'))
    BROWSER = CaisseEpargne

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

    def iter_accounts(self):
        with self.browser:
            return self.browser.get_accounts_list()

    def get_account(self, _id):
        with self.browser:
            account = self.browser.get_account(_id)

        if account:
            return account
        else:
            raise AccountNotFound()

    def iter_history(self, account):
        with self.browser:
            return self.browser.get_history(account)
Ejemplo n.º 8
0
class AvivaModule(Module, CapBankWealth):
    NAME = 'aviva'
    DESCRIPTION = 'Aviva'
    MAINTAINER = 'Edouard Lambert'
    EMAIL = '*****@*****.**'
    LICENSE = 'LGPLv3+'
    VERSION = '2.1'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Mot de passe'))

    BROWSER = AvivaBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def iter_history(self, account):
        return self.browser.iter_history(account)

    def iter_investment(self, account):
        return self.browser.iter_investment(account)
Ejemplo n.º 9
0
class AmericanExpressModule(Module, CapBank):
    NAME = 'americanexpress'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '1.6'
    DESCRIPTION = u'American Express'
    LICENSE = 'LGPLv3+'
    CONFIG = BackendConfig(ValueBackendPassword('login',    label='Code utilisateur', masked=False),
                           ValueBackendPassword('password', label='Mot de passe'))
    BROWSER = AmericanExpressBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound)

    def iter_history(self, account):
        return self.browser.iter_history(account)

    def iter_coming(self, account):
        return self.browser.iter_coming(account)
Ejemplo n.º 10
0
class MyedenredModule(Module, CapBank):
    NAME = 'myedenred'
    DESCRIPTION = 'MyEdenRed'
    MAINTAINER = 'Théo Dorée'
    EMAIL = '*****@*****.**'
    LICENSE = 'AGPLv3+'
    VERSION = '1.4'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Adresse email', masked=False),
        ValueBackendPassword('password', label='Mot de passe'))

    BROWSER = MyedenredBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, id):
        return find_object(self.iter_accounts(), id=id, error=AccountNotFound)

    def iter_history(self, account):
        if not isinstance(account, Account):
            account = self.get_account(account)
        return self.browser.iter_history(account)
Ejemplo n.º 11
0
class BinckModule(Module, CapBankWealth):
    NAME = 'binck'
    DESCRIPTION = u'Binck'
    MAINTAINER = u'Edouard Lambert'
    EMAIL = '*****@*****.**'
    LICENSE = 'LGPLv3+'
    VERSION = '2.1'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Mot de passe'))

    BROWSER = BinckBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

    def get_account(self, _id):
        return find_object(self.browser.iter_accounts(),
                           id=_id,
                           error=AccountNotFound)

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

    def iter_history(self, account):
        return self.browser.iter_history(account)

    def iter_investment(self, account):
        return self.browser.iter_investment(account)
Ejemplo n.º 12
0
class BredModule(Module, CapBank):
    NAME = 'bred'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '1.2'
    DESCRIPTION = u'Bred'
    LICENSE = 'AGPLv3+'
    CONFIG = BackendConfig(ValueBackendPassword('login',    label='Identifiant', masked=False),
                           ValueBackendPassword('password', label='Mot de passe'),
                           Value('website', label=u"Site d'accès", default='bred',
                                 choices={'bred': 'BRED', 'dispobank': 'DispoBank'}),
                           Value('accnum', label=u'Numéro du compte bancaire (optionnel)', default='', masked=False)
                          )

    BROWSERS = {'bred': BredBrowser,
                'dispobank': DispoBankBrowser,
               }

    def create_default_browser(self):
        self.BROWSER = self.BROWSERS[self.config['website'].get()]
        return self.create_browser(self.config['accnum'].get().replace(' ','').zfill(11),
                                   self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound)

    def iter_history(self, account):
        return self.browser.get_history(account)
Ejemplo n.º 13
0
class LendosphereModule(Module, CapBankWealth):
    NAME = 'lendosphere'
    DESCRIPTION = 'Lendosphere'
    MAINTAINER = 'Vincent A'
    EMAIL = '*****@*****.**'
    LICENSE = 'LGPLv3+'
    VERSION = '2.1'

    BROWSER = LendosphereBrowser

    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Email', masked=False),
        ValueBackendPassword('password', label='Mot de passe'),
    )

    def create_default_browser(self):
        return self.create_browser(
            self.config['login'].get(),
            self.config['password'].get(),
        )

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

    def iter_investment(self, account):
        return self.browser.iter_investment(account)
Ejemplo n.º 14
0
class GanAssurancesModule(Module, CapBank):
    NAME = 'ganassurances'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '1.1'
    DESCRIPTION = u'Groupama'
    LICENSE = 'AGPLv3+'
    website_choices = OrderedDict([(k, u'%s (%s)' % (v, k)) for k, v in sorted({
        'espaceclient.groupama.fr':    u'Groupama Banque',
        'espaceclient.ganassurances.fr':   u'Gan Assurances',
        }.iteritems(), key=lambda k_v: (k_v[1], k_v[0]))])
    CONFIG = BackendConfig(Value('website',  label='Banque', choices=website_choices, default='espaceclient.ganassurances.fr'),
                           ValueBackendPassword('login',    label=u'Numéro client', masked=False),
                           ValueBackendPassword('password', label=u"Code d'accès"))
    BROWSER = GanAssurances

    def create_default_browser(self):
        return self.create_browser(self.config['website'].get(),
                                   self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound)

    def iter_history(self, account):
        return self.browser.get_history(account)

    def iter_coming(self, account):
        return self.browser.get_coming(account)
Ejemplo n.º 15
0
class CarrefourBanqueModule(Module, CapBank):
    NAME = 'carrefourbanque'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '1.3'
    DESCRIPTION = u'Carrefour Banque'
    LICENSE = 'AGPLv3+'
    CONFIG = BackendConfig(
        ValueBackendPassword('login',
                             label=u'Votre Identifiant Internet',
                             masked=False),
        ValueBackendPassword('password', label=u"Code d'accès", regexp=u'\d+'))
    BROWSER = CarrefourBanque

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        return find_object(self.browser.get_accounts_list(),
                           id=_id,
                           error=AccountNotFound)

    def iter_history(self, account):
        return self.browser.iter_history(account)

    def iter_investment(self, account):
        return self.browser.iter_investment(account)
Ejemplo n.º 16
0
class LunchrModule(Module, CapBank):
    NAME = 'lunchr'
    DESCRIPTION = 'Lunchr'
    MAINTAINER = 'Roger Philibert'
    EMAIL = '*****@*****.**'
    LICENSE = 'LGPLv3+'
    VERSION = '2.1'

    BROWSER = LunchrBrowser

    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='E-mail', masked=False),
        ValueBackendPassword('password', label='Mot de passe'),
    )

    def create_default_browser(self):
        return self.create_browser(
            self.config['login'].get(),
            self.config['password'].get(),
        )

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

    def iter_history(self, account):
        return self.browser.iter_history(account)
Ejemplo n.º 17
0
class BarclaysModule(Module, CapBank):
    NAME = 'barclays'
    MAINTAINER = u'Jean Walrave'
    EMAIL = '*****@*****.**'
    VERSION = '1.4'
    DESCRIPTION = u'Barclays'
    LICENSE = 'AGPLv3+'
    CONFIG = BackendConfig(ValueBackendPassword('login',    label=u"N° d'abonné", masked=False),
                           ValueBackendPassword('password', label='Code confidentiel'),
                           ValueBackendPassword('secret',   label='Mot secret'))
    BROWSER = Barclays

    def create_default_browser(self):
        return self.create_browser(self.config['secret'].get(),
                                   self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        return find_object(self.browser.iter_accounts(), id=_id, error=AccountNotFound)

    def iter_history(self, account):
        return self.browser.iter_history(account)

    def iter_coming(self, account):
        return self.browser.iter_coming(account)

    def iter_investment(self, account):
        return self.browser.iter_investments(account)
Ejemplo n.º 18
0
class BoursoramaModule(Module, CapBank):
    NAME = 'boursorama'
    MAINTAINER = u'Gabriel Kerneis'
    EMAIL = '*****@*****.**'
    VERSION = '1.2'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = u'Boursorama'
    CONFIG = BackendConfig(ValueBackendPassword('login',      label='Identifiant', masked=False),
                           ValueBackendPassword('password',   label='Mot de passe'),
                           ValueBool('enable_twofactors',     label='Send validation sms', default=False),
                           Value('device',                    label='Device name', regexp='\w*', default=''),
                           Value('pin_code',                  label='Sms code', required=False),
                          )
    BROWSER = Boursorama

    def create_default_browser(self):
        return self.create_browser(self.config)

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

    def get_account(self, _id):
        with self.browser:
            account = self.browser.get_account(_id)
        if account:
            return account
        else:
            raise AccountNotFound()

    def iter_history(self, account):
        return self.browser.get_history(account)

    def iter_investment(self, account):
        return self.browser.get_investment(account)
Ejemplo n.º 19
0
class AlloRestoModule(Module, CapBank):
    NAME = 'alloresto'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '1.3'
    DESCRIPTION = u'Allo Resto'
    LICENSE = 'AGPLv3+'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Mot de passe'))
    BROWSER = AlloRestoBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        account = self.browser.get_account(_id)

        if account:
            return account
        else:
            raise AccountNotFound()

    def iter_history(self, account):
        return self.browser.get_history(account)

    def iter_coming(self, account):
        return self.browser.get_coming(account)
Ejemplo n.º 20
0
class CitelisModule(Module, CapBank):
    NAME = 'citelis'
    DESCRIPTION = u'Citélis'
    MAINTAINER = u'Laurent Bachelier'
    EMAIL = '*****@*****.**'
    LICENSE = 'AGPLv3+'
    VERSION = '1.2'

    BROWSER = CitelisBrowser

    CONFIG = BackendConfig(
        ValueBackendPassword('merchant_id', label='Merchant ID', masked=False),
        ValueBackendPassword('login', label='Account ID', masked=False),
        ValueBackendPassword('password', label='Password'))

    def create_default_browser(self):
        return self.create_browser(self.config['merchant_id'].get(),
                                   self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        for account in self.iter_accounts():
            if account.id == _id:
                return account
        raise AccountNotFound()

    def iter_history(self, account):
        return self.browser.iter_history(account)
Ejemplo n.º 21
0
class IdeelModule(Module, CapShop):
    NAME = 'ideel'
    MAINTAINER = u'Oleg Plakhotniuk'
    EMAIL = '*****@*****.**'
    VERSION = '1.3'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = u'Ideel'
    CONFIG = BackendConfig(
        ValueBackendPassword('username', label='User name', masked=False),
        ValueBackendPassword('password', label='Password'))
    BROWSER = Ideel

    def create_default_browser(self):
        return self.create_browser(self.config['username'].get(),
                                   self.config['password'].get())

    def get_currency(self):
        return self.browser.get_currency()

    def get_order(self, id_):
        return self.browser.get_order(id_)

    def iter_orders(self):
        return self.browser.iter_orders()

    def iter_payments(self, order):
        return self.browser.iter_payments(order)

    def iter_items(self, order):
        return self.browser.iter_items(order)
Ejemplo n.º 22
0
class DelubacModule(Module, CapBank):
    NAME = 'delubac'
    DESCRIPTION = u'Banque Delubac & Cie'
    MAINTAINER = u'Noe Rubinstein'
    EMAIL = '*****@*****.**'
    VERSION = '1.4'

    BROWSER = DelubacBrowser

    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Mot de passe', regexp='^\d+$'))

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

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

    def get_account(self, _id):
        return self.browser.get_account(_id)

    def iter_history(self, account, coming=False):
        return self.browser.iter_history(account)
Ejemplo n.º 23
0
class CaelsModule(Module, CapBank):
    NAME = 'caels'
    DESCRIPTION = u'Crédit Agricole - Epargne Longue des Salariés'
    MAINTAINER = u'Edouard Lambert'
    EMAIL = '*****@*****.**'
    LICENSE = 'AGPLv3+'
    VERSION = '1.4'
    CONFIG = BackendConfig(
            ValueBackendPassword('login',    label='Identifiant', masked=False),
            ValueBackendPassword('password', label='Mot de passe'))

    BROWSER = CAELSBrowser

    def create_default_browser(self):
        return self.create_browser("https://www.ca-els.com/",
                                   self.config['login'].get(),
                                   self.config['password'].get(),
                                   weboob=self.weboob)

    def get_account(self, id):
        return find_object(self.iter_accounts(), id=id, error=AccountNotFound)


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

    def iter_investment(self, account):
        return self.browser.iter_investments(account)

    def iter_history(self, account):
        return self.browser.iter_history(account)
Ejemplo n.º 24
0
class AmazonStoreCardModule(Module, CapBank):
    NAME = 'amazonstorecard'
    MAINTAINER = u'Oleg Plakhotniuk'
    EMAIL = '*****@*****.**'
    VERSION = '1.4'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = u'Amazon Store Card'
    CONFIG = BackendConfig(
        ValueBackendPassword('username', label='User ID', masked=False),
        ValueBackendPassword('password', label='Password'),
        ValueBackendPassword('phone',
                             label='Phone to send verification code to',
                             masked=False),
        ValueBackendPassword('code_file',
                             label='File to read the verification code from',
                             masked=False))
    BROWSER = AmazonStoreCard

    def create_default_browser(self):
        return self.create_browser(username=self.config['username'].get(),
                                   password=self.config['password'].get(),
                                   phone=self.config['phone'].get(),
                                   code_file=self.config['code_file'].get())

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

    def get_account(self, id_):
        return self.browser.get_account(id_)

    def iter_history(self, account):
        return self.browser.iter_history(account)
Ejemplo n.º 25
0
class PradoepargneModule(Module, CapBank):
    NAME = 'pradoepargne'
    DESCRIPTION = u'Prado Épargne Salariale'
    MAINTAINER = u'Edouard Lambert'
    EMAIL = '*****@*****.**'
    LICENSE = 'AGPLv3+'
    VERSION = '1.3'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Mot de passe'))

    BROWSER = CmesBrowser

    def create_default_browser(self):
        return self.create_browser(self.weboob,
                                   "https://www.gestion-epargne-salariale.fr",
                                   self.config['login'].get(),
                                   self.config['password'].get(),
                                   "pradoepargne/")

    def get_account(self, _id):
        return find_object(self.browser.iter_accounts(),
                           id=_id,
                           error=AccountNotFound)

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

    def iter_history(self, account):
        return self.browser.iter_history(account)

    def iter_investment(self, account):
        return self.browser.iter_investment(account)
Ejemplo n.º 26
0
class HSBCModule(Module, CapBank):
    NAME = 'hsbc'
    MAINTAINER = u'Romain Bignon'
    EMAIL = '*****@*****.**'
    VERSION = '1.2'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = 'HSBC France'
    CONFIG = BackendConfig(ValueBackendPassword('login',      label='Identifiant', masked=False),
                           ValueBackendPassword('password',   label='Mot de passe'),
                           Value(               'secret',     label=u'Réponse secrète'))
    BROWSER = HSBC

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get(),
                                   self.config['secret'].get())

    def iter_accounts(self):
        for account in self.browser.get_accounts_list():
            yield account

    def get_account(self, _id):
        return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound)

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

    def iter_coming(self, account):
        for tr in self.browser.get_history(account, coming=True):
            yield tr
Ejemplo n.º 27
0
class SogecartenetModule(Module, CapBank):
    NAME = 'sogecartenet'
    DESCRIPTION = 'Sogecarte Net'
    MAINTAINER = 'Guillaume Risbourg'
    EMAIL = '*****@*****.**'
    LICENSE = 'LGPLv3+'
    VERSION = '2.1'
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Mot de passe'),
        Value('website',
              label="Type d'accès",
              default='titulaire',
              choices={
                  'titulaire': 'Accès Titulaire de carte Affaires',
                  'entreprise': 'Accès Administrateur Entreprise',
              }),
    )

    def create_default_browser(self):
        browsers = {
            'titulaire': SogecarteTitulaireBrowser,
            'entreprise': SogecarteEntrepriseBrowser,
        }
        self.BROWSER = browsers[self.config['website'].get()]
        return self.create_browser(self.config)

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

    def iter_history(self, account):
        return self.browser.iter_history(account)

    def iter_coming(self, account):
        return self.browser.iter_coming(account)
Ejemplo n.º 28
0
class AmeliProModule(Module, CapDocument):
    NAME = 'amelipro'
    DESCRIPTION = u'Ameli website: French Health Insurance for Professionals'
    MAINTAINER = u'Christophe Lampin'
    EMAIL = '*****@*****.**'
    VERSION = '1.3'
    LICENSE = 'AGPLv3+'
    BROWSER = AmeliProBrowser
    CONFIG = BackendConfig(ValueBackendPassword('login',
                                                label='numero de SS',
                                                masked=False),
                           ValueBackendPassword('password',
                                                label='Password',
                                                masked=True)
                           )

    def create_default_browser(self):
        self.logger.settings['save_responses'] = False # Set to True to help debugging
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

    def iter_subscription(self):
        return self.browser.get_subscription_list()

    def get_subscription(self, _id):
        if not _id.isdigit():
            raise SubscriptionNotFound()
        subscription = self.browser.get_subscription(_id)
        if not subscription:
            raise SubscriptionNotFound()
        else:
            return subscription

    def iter_documents_history(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        return self.browser.iter_history(subscription)

    def get_details(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        return self.browser.get_details(subscription)

    def iter_documents(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        return self.browser.iter_documents()

    def get_document(self, id):
        bill = self.browser.get_document(id)
        if not bill:
            raise DocumentNotFound()
        else:
            return bill

    def download_document(self, bill):
        if not isinstance(bill, Bill):
            bill = self.get_document(bill)
        return self.browser.download_document(bill)
Ejemplo n.º 29
0
class EdfModule(Module, CapBill):
    NAME = 'edf'
    DESCRIPTION = u'Edf website: French power provider'
    MAINTAINER = u'Christophe Gouiran'
    EMAIL = '*****@*****.**'
    VERSION = '1.1'
    LICENSE = 'AGPLv3+'
    BROWSER = EdfBrowser
    CONFIG = BackendConfig(
        ValueBackendPassword('login', label='Identifiant', masked=False),
        ValueBackendPassword('password', label='Password', masked=True))
    BROWSER = EdfBrowser

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

    def iter_subscription(self):
        return self.browser.iter_subscription_list()

    def get_subscription(self, _id):
        with self.browser:
            subscription = self.browser.get_subscription(_id)
        if not subscription:
            raise SubscriptionNotFound()
        else:
            return subscription

    def iter_bills_history(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        with self.browser:
            return self.browser.iter_history(subscription)

    def get_details(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        with self.browser:
            return self.browser.iter_details(subscription)

    def iter_bills(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        with self.browser:
            return self.browser.iter_bills(subscription)

    def get_bill(self, id):
        with self.browser:
            bill = self.browser.get_bill(id)
        if not bill:
            raise BillNotFound()
        else:
            return bill

    def download_bill(self, bill):
        if not isinstance(bill, Bill):
            bill = self.get_bill(bill)
        with self.browser:
            return self.browser.readurl(bill._url)
Ejemplo n.º 30
0
class FreeMobileModule(Module, CapDocument, CapMessages, CapMessagesPost):
    NAME = 'freemobile'
    MAINTAINER = u'Florent Fourcot'
    EMAIL = '*****@*****.**'
    VERSION = '1.3'
    LICENSE = 'AGPLv3+'
    DESCRIPTION = 'Free Mobile website'
    CONFIG = BackendConfig(
        ValueBackendPassword('login',
                             label='Account ID',
                             masked=False,
                             regexp='^(\d{8}|)$'),
        ValueBackendPassword('password', label='Password'))
    BROWSER = Freemobile

    def create_default_browser(self):
        return self.create_browser(self.config['login'].get(),
                                   self.config['password'].get())

    def iter_subscription(self):
        return self.browser.get_subscription_list()

    def get_subscription(self, _id):
        return find_object(self.iter_subscription(),
                           id=_id,
                           error=SubscriptionNotFound)

    def iter_documents_history(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        return self.browser.get_history(subscription)

    def get_document(self, _id):
        subid = _id.split('.')[0]
        subscription = self.get_subscription(subid)

        return find_object(self.iter_documents(subscription),
                           id=_id,
                           error=DocumentNotFound)

    def iter_documents(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        return self.browser.iter_documents(subscription)

    def get_details(self, subscription):
        if not isinstance(subscription, Subscription):
            subscription = self.get_subscription(subscription)
        return self.browser.get_details(subscription)

    def download_document(self, bill):
        if not isinstance(bill, Bill):
            bill = self.get_document(bill)
        return self.browser.open(bill.url).content

    def post_message(self, message):
        if not message.content.strip():
            raise CantSendMessage(u'Message content is empty.')
        return self.browser.post_message(message)