Browse Source

Update documentation

Ian Adam Naval 5 years ago
parent
commit
3d69f68f1a

+ 12
- 9
docs/api.rst View File

@@ -9,7 +9,10 @@ Console
9 9
 
10 10
 .. automodule:: librebudget.formatters.console
11 11
    :members:
12
-
12
+   :undoc-members:
13
+   :special-members:
14
+   :exclude-members: __dict__,__weakref__,__module__
15
+   :show-inheritance:
13 16
 
14 17
 Scrapers
15 18
 --------
@@ -19,17 +22,17 @@ Common
19 22
 
20 23
 .. automodule:: librebudget.scrapers.common
21 24
    :members:
25
+   :undoc-members:
26
+   :special-members:
27
+   :exclude-members: __dict__,__weakref__,__module__
28
+   :show-inheritance:
22 29
 
23 30
 Bank of America
24 31
 ~~~~~~~~~~~~~~~
25 32
 
26 33
 .. automodule:: librebudget.scrapers.bank_of_america
27 34
    :members:
28
-
29
-
30
-
31
-Core
32
-----
33
-
34
-.. automodule:: librebudget_core
35
-   :members:
35
+   :undoc-members:
36
+   :special-members:
37
+   :exclude-members: __dict__,__weakref__,__module__
38
+   :show-inheritance:

+ 7
- 4
librebudget/formatters/console.py View File

@@ -2,12 +2,15 @@
2 2
 
3 3
 
4 4
 class ConsoleFormatter(object):
5
-    """Formats data to be printed to a console.
6
-
7
-    :param account_data: The account data from the
8
-        `librebudget.scrapers.Scraper`."""
5
+    """Formats data to be printed to a console."""
9 6
 
10 7
     def __init__(self, account_data):
8
+        """Initializes the :py:class:`ConsoleFormatter`.
9
+
10
+        :param account_data: The account data from the
11
+            :py:class:`librebudget.scrapers.common.BankScraper`.
12
+
13
+        """
11 14
         self.account_data = account_data
12 15
 
13 16
     def as_string(self):

+ 2
- 0
librebudget/scrapers/bank_of_america.py View File

@@ -16,6 +16,7 @@ class BankOfAmericaWebAuthenticator(BankWebAuthenticator):
16 16
 
17 17
     Currently, we deal with the "Verify your Identity" page by parsing
18 18
     the question and prompting the user.
19
+
19 20
     """
20 21
 
21 22
     def login(self, driver, credentials):
@@ -39,6 +40,7 @@ class BankOfAmericaWebAuthenticator(BankWebAuthenticator):
39 40
 
40 41
 
41 42
 class BankOfAmericaBankScraper(BankScraper):
43
+    """Basic scraper for Bank of America."""
42 44
 
43 45
     ACCOUNTS_URL = ("https://secure.bankofamerica.com/myaccounts/brain/"
44 46
                     "redirect.go?target=accountsoverview&request_locale=en-us")

+ 13
- 4
librebudget/scrapers/common.py View File

@@ -2,10 +2,16 @@
2 2
 
3 3
 
4 4
 class BankWebAuthenticator(object):
5
+    """Generic interface for a tool which interacts with a banking
6
+    website and handles authentication."""
5 7
 
6 8
     def login(self, driver, credentials):
7 9
         """Logs a user in using the given credentials.
8 10
 
11
+        :param driver: A Selenium WebDriver
12
+        :param credentials: Two-tuple of (username, password) used to
13
+            authenitcate with the bank website.
14
+
9 15
         :return: Whether the login was successful
10 16
         """
11 17
         raise NotImplementedError("Must extend BankWebAuthenticator")
@@ -15,12 +21,15 @@ class BankScraper(object):
15 21
     """Generic interface for a Web scraper that pulls information from
16 22
     bank websites.
17 23
 
18
-    :param driver: A Selenium web driver
19
-    :param authenticator: A BankWebAuthenticator
20
-
21 24
     """
22 25
 
23 26
     def __init__(self, driver, authenticator):
27
+        """Initializes the :py:class:`BankScraper`.
28
+
29
+        :param driver: A Selenium web driver
30
+        :param authenticator: A `BankWebAuthenticator`
31
+
32
+        """
24 33
         assert isinstance(authenticator, BankWebAuthenticator)
25 34
         self.driver = driver
26 35
         self.authenticator = authenticator
@@ -30,7 +39,7 @@ class BankScraper(object):
30 39
         Locally caches if possible.
31 40
 
32 41
         :param credentials: Credentials for the authenticator
33
-            two-tuple of (username ,password)
42
+            two-tuple of (username, password)
34 43
         :param refresh: Forces the scraper to ignore local cache
35 44
 
36 45
         :return: The data retrieved

Loading…
Cancel
Save