Giter VIP home page Giter VIP logo

buddi-currency-converter's Introduction

Buddi currency converter

This simple PHP script was created to convert Buddi ( http://buddi.digitalcave.ca/ ) data XML from one currency to another. Buddi internally does not allow to specify relations between different currencies. And if you ever need to convert from one to another (for example if you move to different country and need to switch from USD to EUR) there is no easy way to handle this. To use this script you first need to export Buddi data XML, run script on it by specifying path to data file and your rate for conversion.

WARNING: Always make backups.

WARNING: There is no guarantee that this script converts things properly.

WARNING: Script does not evaluate real structure of XML file, but simply converts all float/long fields. At the time of writing it worked properly, however this is WRONG way to do things. Only correct nodes should be converted. Plus this approach makes conversion slow. In my case it took 35 seconds for 7.5MB big XML file ( 7500 transactions).

WARNING: Keep in mind that conversion might not be 100% accurate because of rounding. Conversion will happen on every transaction and as a result totals will differ a bit.

Usage: php buddi.php -f ~/path_to_buddi.xml -r 0.702804

This will take XML file in specified path and will apply rate 0.702804 to all stored float's/long's. Example is for conversion I had to do when changed base currency Lat's to Euro ( 0.702804 LVL == 1 EUR ). If everything will work fine, then in the same directory where you had your Buddi XML file, you should see 'converted_buddi.xml'.

If you do not have Buddi XML file you can get it by extracting. This can be done with command like this: $ java -jar ~/Buddi-3.4.1.6.jar --extract ~/Buddi/buddi.buddi3 In --extract you should pass path to your Buddi data file. After extraction in the same directory where data file is located you should see newly created Buddi XML. If it is not there, try to use different Buddi JAR file. At the time of writing, most recent version (3.4.1.11) was not able to extract XML, but 3.4.1.6 was.

To import converted XML file back into Buddi use: $ java -jar ~/Buddi-3.4.1.11.jar --import ~/Buddi/converted_buddi.xml

NOTE: import flag was added only in version 3.4.1.11

This projected is licensed under the terms of the MIT license.

Copyright (c) Endijs Lisovskis 2013 [email protected]

buddi-currency-converter's People

Contributors

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