Git Product home page Git Product logo

gnucash-xml-split's Introduction

gnucash-xml-split

Split GnuCash XML files into files containing transaction in a certain period (e.g. a year).

This utility is used to split big GnuCash XML files into yearly basis. As I kept using GnuCash, the data file is getting larger and larger. However, GnuCash does not seem to willing to provide the functionality to split data files, only to add year end book-closing transactions. Hence the utility.

Usage

gnucash-xml-split.py -i input.gnucash -o out.xml -y 2014

-i input.gnucash The input zipped GnuCash XML file. This file will stay not changed in the operation. -o out.xml The output GnuCash XML file. This file is a text XML file which not zipped. It would contain all transactions happen in the year specified by -y, all other transactions (either before or after the year) will be removed. -y 2014 The year to extract transactions.

Other output files: This utility will NOT add any transaction in the output file. Opening balancs are saved in QIF files. All transactions before the year will be used to calculate the opening balances, and all accounts except INCOME, EXPENSE, EQUITY accounts would included. As QIF format does not have currency information, accounts with different currencies will be save in different files. The generated file name would be YearCurrency.qif. In the above example, 2014USD.qif would be generated for US dollars opening balance. You'll have to import the file in GnuCash manually. The opening balances comes from account: Equity:Opening Balances:USD. Different accounts will be used for different currencies.

Note

It should be easy to modify the utility to extract transations in arbitrary period. By my guest.

If you find any bug or inconvenience, feel free to open an issue.

gnucash-xml-split's People

Contributors

fefe982 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gnucash-xml-split's Issues

add year range and starting balance transaction

Hi. I really needed GnuCash XML Splitter, so I have taken it and added some additional features.
Most importantly are being able to specify a range of years and writing a "starting balance" transaction directly to the output file.

  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input file name
  -o OUTPUT, --output OUTPUT
                        output file name
  -y YEAR, --year YEAR  begin year of transations to extract
  -e END_YEAR, --end-year END_YEAR
                        end year of transactions
  -n, --nozip           do not zip output files
  -z, --zero            zero starting balances in extracted file
  -q, --qif             write starting balances to .qif file

The default behavior has changed. To get the original behavior use:
-y year -e year -n -q
I'm new to GitHub but I would be glad to contribute this update.

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.