Finance::QIF - Parse and create Quicken Interchange Format files
use Finance::QIF;
my $qif = Finance::QIF->parse_file("foo.qif"); $qif = Finance::QIF->parse("foo.qif"); for my $entry ($qif->transactions) { print $entry->payee, ": ", $entry->amount,"\n"; }
my $qif = Finance::QIF->new(type => "Bank"); $qif->add($transaction); $qif->add( amount => -50.00, payee => "Simon Cozens", memo => "We really should have given him more for producing all these cool modules", date => "12/19/2002", category => "Advertising/Subliminal" ); print $qif->as_qif; print $qif; # Stringification is overloaded too
This module handles and creates files in Intuit's Quicken Interchange Format. A spec for this format can be found at http://www.respmech.com/mym2qifw/qif_new.htm; this implementation is liberal in terms of date formats, doing no date checking and simply passing on whatever it receives.
Create a new, blank QIF object. A type must be specified, but for this release, the only thing we support is "Bank" accounts, since I'm not wise enough to have investment accounts yet and so don't need that functionality.
Returns the QIF object as a string in QIF format.
Adds a new transaction; this may be a Finance::QIF::Transaction object (see below) or a hash.
Finance::QIF::Transaction
Creates a Finance::QIF object from an existing file.
Finance::QIF
Creates a Finance::QIF object from a string.
Returns a list of Finance::QIF::Transactions. See below.
Individual transactions are objects of the class Finance::QIF::Transaction. These objects will be returned from the transactions method on a Finance::QIF object, and can be created, queried and modified with the following methods.
transactions
Creates a new transaction object and populates it with data.
Gets/sets the transaction's amount. No currency is implied. The amount is always returned as a string formatted to two decimal places.
REMEMBER that outgoing transactions should always be specified as a negative amount.
These are ordinary get-set methods for the specified fields. "Number" in QIF refers to a check or reference number.
Gets and sets an array of split values each specified as a hash reference. For example:
$item->amount(-30); $item->payee("Cash withdrawal"); $item->splits( { category => "Food/Groceries", amount => 12.00 }, { category => "Stationery", amount => 5.00 }, { category => "Dining Out", amount => 13.00 } )
Adds a split entry (as a hash reference) to the split list. This does not affect the amount of the transaction.
$item->add_to_splits( { category => "Dining Out", amount => 13.00 } );
Returns the transaction in QIF format.
Copyright (c) 2004 by Nathan McFarland. All rights reserved. This program is free software; you may redistribute it and or modify it under the terms of the Artistic license.
Nathan McFarland, nmcfarl@cpan.org
nmcfarl@cpan.org
Simon Cozens, simon@cpan.org
simon@cpan.org
perl.
To install Finance::QIF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::QIF
CPAN shell
perl -MCPAN -e shell install Finance::QIF
For more information on module installation, please visit the detailed CPAN module installation guide.