Skip to content

Commit

Permalink
Final Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
burkematthew committed Mar 28, 2022
1 parent 6747c58 commit a4c4b82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
13 changes: 3 additions & 10 deletions mintapi/api.py
@@ -1,7 +1,5 @@
from datetime import date, datetime, timedelta
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
import io
import json
import logging
import os
import random
Expand All @@ -10,9 +8,6 @@
import time
import warnings

import xmltodict
import pandas as pd

from mintapi.signIn import sign_in, _create_web_driver_at_mint_com


Expand Down Expand Up @@ -381,12 +376,10 @@ def get_net_worth(self, account_data=None):
account_data = self.get_account_data()

# account types in this list will be subtracted
invert = set(["loan", "loans", "credit"])
invert = set(["LoanAccount", "CreditAccount"])
return sum(
[
-a["currentBalance"]
if a["accountType"] in invert
else a["currentBalance"]
-a["currentBalance"] if a["type"] in invert else a["currentBalance"]
for a in account_data
if a["isActive"]
]
Expand Down
19 changes: 0 additions & 19 deletions mintapi/cli.py
Expand Up @@ -3,7 +3,6 @@
import os
import sys
import json
from datetime import datetime
import getpass

import keyring
Expand Down Expand Up @@ -269,24 +268,6 @@ def parse_arguments(args):
return cmdline.parse_args(args)


def make_accounts_presentable(accounts, presentable_format="EXCEL"):
formatter = {
"DATE": "%Y-%m-%d",
"ISO8601": "%Y-%m-%dT%H:%M:%SZ",
"EXCEL": "%Y-%m-%d %H:%M:%S",
}[presentable_format]

for account in accounts:
for k, v in account.items():
if isinstance(v, datetime):
account[k] = v.strftime(formatter)
return accounts


def print_accounts(accounts):
print(json.dumps(make_accounts_presentable(accounts), indent=2))


def handle_password(type, prompt, email, password, use_keyring=False):
if use_keyring and not password:
# If we don't yet have a password, try prompting for it
Expand Down

0 comments on commit a4c4b82

Please sign in to comment.