commit 3928b2525b77dfc425510ee8a62864669b03538b Author: zevav Date: Wed May 17 11:17:44 2017 -0400 first diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..c23ecac --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..6374de0 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b0d6bf2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/splurgebot.iml b/.idea/splurgebot.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/splurgebot.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..4dfb3aa --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1495033991112 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..33accd8 --- /dev/null +++ b/__init__.py @@ -0,0 +1,8 @@ +import os + +import plaid + + +plaid_client = plaid.Client( + client_id=os.getenv('PLAID_CLIENT_ID'), secret=os.getenv('PLAID_SECRET'), public_key=os.getenv('PLAID_PUBLIC_KEY'), + environment='sandbox') diff --git a/get_institution_info.py b/get_institution_info.py new file mode 100644 index 0000000..24e2570 --- /dev/null +++ b/get_institution_info.py @@ -0,0 +1,21 @@ +from __init__ import plaid_client + + +def get_banks_by_name(bank_name): + bank = plaid_client.Institutions.search(bank_name) + return bank['institutions'] + + +def bank_can_get_transactions(bank): + return 'transactions' in bank['products'] + +#too_big_to_fail = ['Bank of America', 'Wells Fargo', 'Chase', 'Citi'] +too_big_to_fail = ['Vermont Federal Credit Union', 'American Express', 'Citi'] +# I only keep my money in banks that are too big to fail. If you can't beat 'em... + +bank_dict = {} + +for bank_name in too_big_to_fail: + banks = get_banks_by_name(bank_name) + if len(banks) > 0: + bank_dict[bank_name] = banks[0]['institution_id'] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2f9763e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +plaid-python==2.0.1 +requests==2.14.2 diff --git a/splurgebot.py b/splurgebot.py new file mode 100644 index 0000000..348b96b --- /dev/null +++ b/splurgebot.py @@ -0,0 +1 @@ +from .get_institution_info import bank_dict