Skip to content

Instantly share code, notes, and snippets.

@bradyt
Created March 27, 2019 07:28
Show Gist options
  • Save bradyt/34f896042dc8c66710668367ab8c2db9 to your computer and use it in GitHub Desktop.
Save bradyt/34f896042dc8c66710668367ab8c2db9 to your computer and use it in GitHub Desktop.
import os.path
from plaid2qif.plaid2qif import open_client, read_access_token, download
CFG_DIR = "./cfg"
CREDENTIALS = os.path.join(CFG_DIR, "plaid-credentials.json")
def return_list_accounts(institution, plaid_credentials):
client = open_client(plaid_credentials)
access_token = read_access_token(institution)
response = client.Accounts.get(access_token)
accounts = response["accounts"]
return accounts
def main():
accounts = return_list_accounts("simple", CREDENTIALS)
for a in accounts:
download(
{"institution": "simple", "name": a["subtype"], "id": a["account_id"]},
{"start": "2017-01-01", "end": "2020-01-01"},
{"dir": "csv", "format": "csv"},
False,
False,
CREDENTIALS,
)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment