Update documentation
This commit is contained in:
parent
558d2d477b
commit
3d69f68f1a
21
docs/api.rst
21
docs/api.rst
@ -9,7 +9,10 @@ Console
|
||||
|
||||
.. automodule:: librebudget.formatters.console
|
||||
:members:
|
||||
|
||||
:undoc-members:
|
||||
:special-members:
|
||||
:exclude-members: __dict__,__weakref__,__module__
|
||||
:show-inheritance:
|
||||
|
||||
Scrapers
|
||||
--------
|
||||
@ -19,17 +22,17 @@ Common
|
||||
|
||||
.. automodule:: librebudget.scrapers.common
|
||||
:members:
|
||||
:undoc-members:
|
||||
:special-members:
|
||||
:exclude-members: __dict__,__weakref__,__module__
|
||||
:show-inheritance:
|
||||
|
||||
Bank of America
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
.. automodule:: librebudget.scrapers.bank_of_america
|
||||
:members:
|
||||
|
||||
|
||||
|
||||
Core
|
||||
----
|
||||
|
||||
.. automodule:: librebudget_core
|
||||
:members:
|
||||
:undoc-members:
|
||||
:special-members:
|
||||
:exclude-members: __dict__,__weakref__,__module__
|
||||
:show-inheritance:
|
||||
|
@ -2,12 +2,15 @@
|
||||
|
||||
|
||||
class ConsoleFormatter(object):
|
||||
"""Formats data to be printed to a console.
|
||||
|
||||
:param account_data: The account data from the
|
||||
`librebudget.scrapers.Scraper`."""
|
||||
"""Formats data to be printed to a console."""
|
||||
|
||||
def __init__(self, account_data):
|
||||
"""Initializes the :py:class:`ConsoleFormatter`.
|
||||
|
||||
:param account_data: The account data from the
|
||||
:py:class:`librebudget.scrapers.common.BankScraper`.
|
||||
|
||||
"""
|
||||
self.account_data = account_data
|
||||
|
||||
def as_string(self):
|
||||
|
@ -16,6 +16,7 @@ class BankOfAmericaWebAuthenticator(BankWebAuthenticator):
|
||||
|
||||
Currently, we deal with the "Verify your Identity" page by parsing
|
||||
the question and prompting the user.
|
||||
|
||||
"""
|
||||
|
||||
def login(self, driver, credentials):
|
||||
@ -39,6 +40,7 @@ class BankOfAmericaWebAuthenticator(BankWebAuthenticator):
|
||||
|
||||
|
||||
class BankOfAmericaBankScraper(BankScraper):
|
||||
"""Basic scraper for Bank of America."""
|
||||
|
||||
ACCOUNTS_URL = ("https://secure.bankofamerica.com/myaccounts/brain/"
|
||||
"redirect.go?target=accountsoverview&request_locale=en-us")
|
||||
|
@ -2,10 +2,16 @@
|
||||
|
||||
|
||||
class BankWebAuthenticator(object):
|
||||
"""Generic interface for a tool which interacts with a banking
|
||||
website and handles authentication."""
|
||||
|
||||
def login(self, driver, credentials):
|
||||
"""Logs a user in using the given credentials.
|
||||
|
||||
:param driver: A Selenium WebDriver
|
||||
:param credentials: Two-tuple of (username, password) used to
|
||||
authenitcate with the bank website.
|
||||
|
||||
:return: Whether the login was successful
|
||||
"""
|
||||
raise NotImplementedError("Must extend BankWebAuthenticator")
|
||||
@ -15,12 +21,15 @@ class BankScraper(object):
|
||||
"""Generic interface for a Web scraper that pulls information from
|
||||
bank websites.
|
||||
|
||||
:param driver: A Selenium web driver
|
||||
:param authenticator: A BankWebAuthenticator
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, driver, authenticator):
|
||||
"""Initializes the :py:class:`BankScraper`.
|
||||
|
||||
:param driver: A Selenium web driver
|
||||
:param authenticator: A `BankWebAuthenticator`
|
||||
|
||||
"""
|
||||
assert isinstance(authenticator, BankWebAuthenticator)
|
||||
self.driver = driver
|
||||
self.authenticator = authenticator
|
||||
@ -30,7 +39,7 @@ class BankScraper(object):
|
||||
Locally caches if possible.
|
||||
|
||||
:param credentials: Credentials for the authenticator
|
||||
two-tuple of (username ,password)
|
||||
two-tuple of (username, password)
|
||||
:param refresh: Forces the scraper to ignore local cache
|
||||
|
||||
:return: The data retrieved
|
||||
|
Loading…
x
Reference in New Issue
Block a user