From 3928b2525b77dfc425510ee8a62864669b03538b Mon Sep 17 00:00:00 2001 From: zevav Date: Wed, 17 May 2017 11:17:44 -0400 Subject: [PATCH] first --- .../inspectionProfiles/profiles_settings.xml | 7 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/splurgebot.iml | 11 ++ .idea/vcs.xml | 6 + .idea/workspace.xml | 157 ++++++++++++++++++ __init__.py | 8 + get_institution_info.py | 21 +++ requirements.txt | 2 + splurgebot.py | 1 + 10 files changed, 225 insertions(+) create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/splurgebot.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 __init__.py create mode 100644 get_institution_info.py create mode 100644 requirements.txt create mode 100644 splurgebot.py 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