Coder Social home page Coder Social logo

stephanritscher / gnucash-qif-import Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fkoester/gnucash-qif-import

0.0 1.0 0.0 47 KB

GnuCash Python helper script to import transactions from QIF text files into GnuCash's own file format

License: GNU General Public License v3.0

Python 100.00%

gnucash-qif-import's Introduction

GnuCash QIF Import

GnuCash Python helper script to import transactions from QIF text files into GnuCash .gnucash file (or into MySQL).

Main use case for myself was automating the import of QIF files generated by GnuCash Mobile Android app into my desktop GnuCash application.

See also my blog post "Synchronizing GnuCash mobile with GnuCash desktop".

Prerequisites

  • Python 2.7+
  • GnuCash 2.4+
  • GnuCash Python Bindings
  • MySQL Server (optional, to store Gnucash data into MySQL)
  • MTP tools (optional, to import from MTP device)

Getting Started

For Ubuntu 13.04, 14.04:

sudo apt-get install gnucash python-gnucash
./import.py -v -f examples/accounts.gnucash examples/expenses.qif

For Ubuntu 13.04, 14.04 (MySQL):

sudo apt-get install gnucash python-gnucash
sudo apt-get install libdbd-mysql
mysql -u $USERNAME -p$PASSWORD -h $HOSTNAME
mysql> create database accounts;
mysql> use accounts;
mysql> source examples/accounts.sql
./import.py -v -f mysql://$USERNAME:$PASSWORD@$HOSTNAME/accounts examples/expenses.qif

The above command should log two "Adding transaction for account.." lines and will add the expenses from examples/expenses.qif to the accounts.gnucash file. Open accounts.gnucash (or the equivalent database in case of MySQL) with GnuCash before and after executing the above command line to see the difference.

The Python script will assume "EUR" as default currency (QIF files do not specify any currency). Use the --currency command line flag to change this.

How to import from MTP device (Android phone)

The import.py script also supports directly importing QIF files from devices supporting MTP, e.g. Android phones. This is handy if you use GnuCash Mobile and want to synchronize (importing previously saved QIF files) when connecting your phone via USB. You need the "mtp-tools" command line programs to use this feature:

sudo apt-get install mtp-tools

To import all files ending with ".qif" from your MTP device (connected via USB) into your "my-accounts" GnuCash file:

./import.py -v -f ~/my-accounts.gnucash mtp:.*.qif

You can use the --dry-run option to do a safe trial run. In order to be able to safely repeat the above command without getting a bunch of duplicate transactions (and to speed up the stupidly slow MTP access), the import.py script remembers the imported file names in ~/.gnucash-qif-import-cache.json.

gnucash-qif-import's People

Contributors

fkoester avatar hiromu2000 avatar hjacobs avatar ranlvor avatar stephanritscher avatar

Watchers

 avatar

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.