Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A python3 based, gnucash to ledger converter

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.