Code Monkey home page Code Monkey logo

cookthebooks's Introduction

cookthebooks

Simple Python3 program to quickly translate GNUCash files to ledger format. Translates a GNUCash file with over 500 transactions in around .3 seconds on a modern machine.

Example

Getting Started

Install the optional dependency for conversion of currency codes to Unicode currency symbols, e.g. GBP becomes £.

$ sudo python3 -m pip install money

Then clone the git repo:

$ git clone https://github.com/colemannugent/cookthebooks
$ cd cookthebooks/

Then all you need to is:

$ ./cookthebooks.py /path/to/your/file.gnucash

By default the program will output all of the converted ledger syntax to STDOUT and all errors or other messages to STDERR for easy redirection to files or other programs.

Note that this program may not work with all versions of GnuCash as there is no published information about the structure of the GnuCash files (that I can find anyway). It works beautifully on my Arch Linux machine running GnuCash 2.7.1.

Usage

usage: cookthebooks.py [-h] [-o OUTFILE] file

Convert gnucash files to ledger files

positional arguments:
  file                  Path to the gnucash file to convert

optional arguments:
  -h, --help            show this help message and exit
  -o OUTFILE, --outfile OUTFILE
                        Output to a file instead of standard output

Implemented

  • Basic tranlation from the GNUCash format to the ledger format
  • Memo lines for splits are preserved as comments
  • Unicode currency symbol support

Not Yet Implemented

  • Scheduled transactions
  • Budgets
  • Cleared transactions

Dependencies

Goals

  • Pre-generate accounts at top of ledger file and impose assertions: http://ledger-cli.org/3.0/doc/ledger3.html#Command-Directives
  • Talk about the display() function in the documentation
    • Maybe even have a command line switch to show the contents of the root account
  • Actual documentation
  • Support for reverse direction conversions from ledger to GNUCash format

cookthebooks's People

Contributors

colemannugent 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.