Giter VIP home page Giter VIP logo

plaid2qif's Introduction

CircleCI GitHub watchers Crates.io PyPi

Plaid2QIF Logo

Plaid2QIF

Description

Plaid2QIF downloads transactions from various financial institutions in JSON format and converts to formats usable by financial software.

Output Formats supported:

  • QIF
  • CSV
  • JSON
  • Extensible to others

Notes

  • Tested extensively with GnuCash. Supported by any financial software that supports import from QIF.
  • Supports any institution supported by Plaid.

Summary

  # Download transactions in various formats (default QIF) from Plaid
  plaid2qif download \
    --account=<account-name> \
    --account-type=<type> \
    --account-id=<acct-id> \
    --from=<from-date> \
    --to=<to-date> \
    [--output-format=<format>] \
    [--output-dir=<path>] \
    [--ignore-pending] \
    [--verbose]

Usage

  1. Install the plaid2qif command using pip

     $ pip install plaid2qif
    
  2. Authenticate and link with your financial institution (first time only). To do this, follow the steps for using the associated Account Linker tool.

  3. Configure your environment with required values. See "Authentication Configuration" below.

  4. Once configured, you're ready to download transactions and save them as QIF files:

     plaid2qif download \
         --from=<yyyy-mm-dd> \
         --to=<yyyy-mm-dd> \
         --account-type=<type> \
         --account=<account-name> \
         --account-id=<plaid-account-id> \
         --credentials=<file>
    
  • account is the path to an account in the ledger in GnuCash that you ultimately want to import the transactions to. This is added to the !Account header in the QIF file. e.g.: Assets: Checking Accounts:Personal Checking Account. If the name has spaces be sure to quote this param.
  • account-type is a GnuCash account identifier type as documented here.
  • account-id is Plaid's account ID for the account you want to download, as obtained via list-accounts above.
  • By default, output will go to stdout to be redirected. If you want it to be written to a location use the output-dir parameter.

Authentication Configuration

  • You will need the following information configured in your environment in order to use this tool.
  • The suggested way to populate your environment would be to use a file named .env in your current working directory. Alternatively you could put the values in your ~/.profile or however you normally initialize your environment.
Configuration Parameter Environment Variable Name Description Notes
Client ID PLAID_CLIENT_ID Plaid's unique indentifier for your Plaid account. Obtain from your dashboard Required.
Client Secret PLAID_SECRET Plaid's authentication token for your Plaid account. Obtain from your dashboard Required.
Plaid Environment PLAID_ENV Operating environment. Optional. Should be one of: sandbox, development, or production. Defaults to development.
Plaid API Version PLAID_API_VERSION Version of the API that the plaid-python library supports. Optional. Defaults to 2020-09-14
Access Token location ACCESS_TOKEN_FILE Location of the token that grants access to a particular financial institution for downloading records from. Required.

Notes on Authentication Configuration

  • The access token and Plaid credentials are sensitive material as they grant access to data within your financial accounts. They should be handled carefully and not shared.

  • These are the most important values that need configuration in order to authenticate with your institution and then download records. Other values can be found in the sample.env.

  • If you're downloading from different institutions that result in multiple access token files, you can override the location of the file at the command line; see below for an example. This approach is open to suggestions for improvement if this doesn't work well for others. See Issue #27.

      $ ACCESS_TOKEN_FILE=./cfg/chase.txt plaid2qif ...
      $ ACCESS_TOKEN_FILE=./cfg/citi.txt plaid2qif ...
    

Distribution

# increment version in `plaid2qif/__init__.py`
# commit everything & push
$ git tag -s vX.Y.Z
$ git push --tags
$ python3 setup.py sdist bdist_wheel
$ twine upload dist/*

plaid2qif's People

Contributors

bhipple avatar dependabot[bot] avatar ebridges avatar jberlinsky avatar jcrben avatar mbafford avatar simondorfman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plaid2qif's Issues

missing "plaid2qif" executable

Still using plaid2qif often, thank you!

I had to reinstall it. I used today's master, and I could not figure out how to run it. README mentions a plaid2qif executable which seems to have gone missing. I copied one I was using before, included here FWIW:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import sys
from plaid2qif.plaid2qif import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Add error messages?

I ran this properly at first, but when I came back to it I accidentally misspelled account as account. It took me a while to figure it out.

Docopt has raise DocoptExit() at the end but it doesn't pass a generic message. In their docs they point to a way to use python-schema for validation https://github.com/docopt/docopt#data-validation.

add support for new `link_token` Plaid API

I tried to use this tool (which looks like exactly what I need!), but I couldn't get it to work at all because in my Plaid dashboard I didn't have a public_key.

It turns out that as of July 23, 2020, Plaid accounts don't have a public_key anymore, just a client and a secret. They've introduced a new link_token system instead, which all new accounts have to use. So new Plaid accounts (created after July 23 2020) won't be able to use plaid2qif until it supports the new link_token flow.

Their migration guide is here: https://plaid.com/docs/upgrade-to-link-tokens/

__init__() takes from 3 to 4 positional arguments but 6 were given

I think I've followed the installation directions exactly, and yet when I try to get my access token, I get the following error:

[2020/07/04 01:13:04][INFO] reading credentials from file: ./plaid-credentials.json
Traceback (most recent call last):
  File "/usr/local/bin/plaid2qif", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/dist-packages/plaid2qif/plaid2qif.py", line 149, in main
    save_access_token(args['--institution'], args['--public-token'], args['--credentials'])
  File "/usr/local/lib/python3.7/dist-packages/plaid2qif/plaid2qif.py", line 108, in save_access_token
    client = open_client(plaid_credentials)
  File "/usr/local/lib/python3.7/dist-packages/plaid2qif/plaid2qif.py", line 139, in open_client
    suppress_warnings)
TypeError: __init__() takes from 3 to 4 positional arguments but 6 were given

Add support for OFX

There might be some interest 1 in the community for this. Please upvote if this would be useful.

How to write out to csv file?

Just want to say this is a great repo. I got through all the steps and I'm able to output my transactions to stdout. I'm pretty new to working with something like this so hopefully you can help, but I'm unsure how to export my transactions to a .csv file. Any help would be great, thank you.

[ANNOUNCEMENT] End of Life

For those using this project, I will continue doing security updates on this project til the end of 2023. If there are others that may be interested in taking this over, I'm open to transferring ownership.

Background: my bank (Chase) now requires 2FA for access from Plaid. In order for me to be an authorized developer with Plaid requires more hoops than I'm interested in jumping through. As a result I will be switching to use CSV exports from Chase for my personal accounting, rather than using Plaid to get transactions.

I will be focussing on developing the tool I wrote for that purpose: csv2qif

Best of luck, and thank you for your support.

Obtaining Plaid developer account

Good day! And thanks for sharing this tool! :)

Did anyone have issues with this?

I signed up a while back, created an account. Which gets you to "Sandbox" level, which if I am understanding correctly, does not allow you to actually do anything live with any of your accounts. For that you need the next level up from that (I forget what they call it) which is still free, but enables real functionality with banks.

I sent the request in, but never heard anything back. So recently I followed up with them (Plaid) and they are now asking for detailed instructions about what I plan to build.

Personally I am strongly against fibbing, but I am worried that if I tell them I plan on personal use only and explain what plain text accounting is, that they might not grant me the developer account.

So I was just curious how others handled this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.