Code Monkey home page Code Monkey logo

gnucash-xml-to-ledger-dat's Introduction

GNUCash's XML to Ledger's Dat File

A script to convert GNUCash's XML file to Ledger's dat file

convert.pl is the script to convert GnuCash's uncompressed XML file to a Ledger journal. I run it using Perl 5.26 on a computer running Ubuntu 18.04.

The file formats for ledger and hledger are very similar, I have been able to generate repors using hledger for the dat file created by the conversion script.

Note: There are other scripts which do the same thing as the Perl script in this repository.

Recipes

Don't install anything

hledger () {
        docker run --rm -v `pwd`:/data -w /data dastapov/hledger hledger $@
}

ledger () {
        docker run --rm -v `pwd`:/data -w /data dcycle/ledger:1 $@
}

Display numbers in the correct format

Commodity directives can be used to ensure that numbers are always displayed in the appropriate format.

$ cat commodities.dat
commodity JPY 1,000,000.
commodity EUR 1,000,000.00
commodity USD 1,000,000.00
commodity INR 10,00,000.

; Enter the appropriate exchange rate for the various commodities here
P 2020-02-08 EUR 0.001 USD

Generate common accounting reports

hledger -f simple.dat incomestatement
hledger -f simple.dat balancesheet
hledger -f simple.dat cashflow

Display all balances in a single currency at present exchange rate

# You _must_ have the exchange rate in USD for all the commodities in the
# commodities.dat file
hledger -f simple.dat bal Assets -Y --value=now,USD

License

Code in this repository is licensed under MIT.

Copyright (C) 2020 Siddharth Kannan [email protected]

gnucash-xml-to-ledger-dat's People

Contributors

icyflame avatar

Watchers

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