# HG changeset patch # User Oscar Curero # Date 1642111571 -3600 # Thu Jan 13 23:06:11 2022 +0100 # Node ID 57d9b0b1f0fa096a16b4757c066a991e0ad91aa7 # Parent 914a6b72b3433e4552a6bf80f8afe983bdb5beb1 fix docs diff --git a/ccb/__init__.py b/ccb/__init__.py --- a/ccb/__init__.py +++ b/ccb/__init__.py @@ -70,7 +70,7 @@ b64encode(password.encode('latin1'))) def get_accounts(self, is_overview=False, all=True): - """Get all accounts + """Get all accounts. Args: is_overview (bool): `True` to return only the accounts with a balance. `False` @@ -91,7 +91,7 @@ for account_data in response.json()['data']] def get_account(self, name=None, account_id=None): - """Get an account + """Get an account. Args: name (str): name of the account @@ -123,7 +123,7 @@ self.get_currency(account_data['currency_code'])) def get_transaction(self, id): - """Get a transaction + """Get a transaction. Args: id (int): ID of the transaction @@ -145,7 +145,7 @@ def get_transactions(self, account=None, created_at=None, from_trans=None, order=None, order_direction=None, separate_splitsid=None): - """Get all transactions + """Get all transactions. This method returns an `Transaction` interator. Args: account (Account): Account to get transactions from. Defaults to all accounts. @@ -161,7 +161,7 @@ parents. If you're trying to retrieve newly added transactions, set this to `True` or else split children will inherit the parent's `created_at` value Returns: - List of `Transaction` + Iterator """ limit = 250 diff --git a/docs/usage.md b/docs/usage.md --- a/docs/usage.md +++ b/docs/usage.md @@ -17,7 +17,7 @@ import ccb session = ccb.ClearCheckBook('user', 'passwd') -for transaction in self.get_transactions(): +for transaction in session.get_transactions(): print(transaction) ``` @@ -30,7 +30,7 @@ session = ccb.ClearCheckBook('user', 'passwd') account = session.get_account('My Account') -for transaction in self.get_transactions(account=account): +for transaction in session.get_transactions(account=account): print(f'Transaction: {transaction.description}, amount: {transaction.amount}') ``` @@ -77,7 +77,7 @@ session = ccb.ClearCheckBook('user', 'passwd') -for transaction in self.get_transactions(): +for transaction in session.get_transactions(): if transaction.description == 'Thing I'm Looking For': break