from docopt import docopt
from pkg_resources import require

def main():
  version = require("transaction-downloader")[0].version
  arguments = docopt(__doc__, version=version)
  print(arguments)

if __name__ == '__main__':
  main()

import json
from docopt import docopt
from pkg_resources import require

def read_credentials(account):
  credentials = {}
  with open('plaid-credentials.json') as json_data:
      credentials = json.load(json_data)
  
  with open('cfg/%s.json'%account) as json_data:
      credentials["account"] = {};
      credentials["account"]["name"] = account
      credentials["account"]["credentials"] = json.load(json_data)

  return credentials

def main():
  version = require("transaction-downloader")[0].version
  arguments = docopt(__doc__, version=version)
  print(arguments)

if __name__ == '__main__':
  main()

Add function to read in plaid + account credentials into one structure.
Add function to read in plaid + account credentials into one structure.

+ import json
  from docopt import docopt
  from pkg_resources import require
+ 
+ def read_credentials(account):
+   credentials = {}
+   with open('plaid-credentials.json') as json_data:
+       credentials = json.load(json_data)
+   
+   with open('cfg/%s.json'%account) as json_data:
+       credentials["account"] = {};
+       credentials["account"]["name"] = account
+       credentials["account"]["credentials"] = json.load(json_data)
+ 
+   return credentials
  
  def main():
    version = require("transaction-downloader")[0].version
    arguments = docopt(__doc__, version=version)
    print(arguments)
  
  if __name__ == '__main__':
    main()
  
Add function to read in plaid + account credentials into one structure.
## Code Before:
from docopt import docopt
from pkg_resources import require

def main():
  version = require("transaction-downloader")[0].version
  arguments = docopt(__doc__, version=version)
  print(arguments)

if __name__ == '__main__':
  main()

## Instruction:
Add function to read in plaid + account credentials into one structure.
## Code After:
import json
from docopt import docopt
from pkg_resources import require

def read_credentials(account):
  credentials = {}
  with open('plaid-credentials.json') as json_data:
      credentials = json.load(json_data)
  
  with open('cfg/%s.json'%account) as json_data:
      credentials["account"] = {};
      credentials["account"]["name"] = account
      credentials["account"]["credentials"] = json.load(json_data)

  return credentials

def main():
  version = require("transaction-downloader")[0].version
  arguments = docopt(__doc__, version=version)
  print(arguments)

if __name__ == '__main__':
  main()
