资源说明:Basic python script to convert CSVs to Ledger format
h1. csvToLedger - Convert CSVs to Ledger This tool allows you to convert CSVs into a format appropriate for "Ledger":https://github.com/jwiegley/ledger. It's particularly useful when you need to specify multipart transactions. h2. Options: |-o "<File Path>", --open="<File Path>"|CSV file to open| |-s "<File Path>", --save="<File Path>"|Save output to a file| |-c "$", --currency="$"|Currency character in data| |-d "date", --date="date"|Name of field containing transaction date| |-n "note", --note="note"|Name of field containing transaction note| |-a "Assets:Checking, Equity:Revenue", --accounts="Assets:Checking, Equity:Revenue"|Comma separated list of accounts| |-f "payment, tax", --fields="payment, tax"|Comma separated list of field names (in the CSV) to include with accounts. Fields prepended with a "-" will flip the sign of the field.| The following examples convert CSVs generated by "TorchCL":http://torch.wbpsystems.com/cl.php ("Torch Project Management's":http://torch.wbpsystems.com/ command line utility) to ledger format. The TorchCL commands that generated these files are:torchCL --list="invoices" --save="invoices.csv" torchCL --list="payments" --save="payments.csv" torchCL --list="expenses" --save="expenses.csv"h2. Invoices:./csvToLedger --open="../sample_csvs/invoices.csv" -a "Assets:Accounts Receivables, Liabilities:Taxes Payable, Equity:Revenue" -f "total,-tax" -d "date" -n "note" -s "../sample_csvs/save.txt"h3. Example File:2008/08/23 * Bill for printing materials and hours Assets:Accounts Receivables 119.01 Liabilities:Taxes Payable (1.014000 * (-1)) Equity:Revenue 2009/10/09 * Bill for services and servicing server Assets:Accounts Receivables 842.00 Liabilities:Taxes Payable (2.000000 * (-1)) Equity:Revenueh2. Payments:./csvToLedger --open="../sample_csvs/payments.csv" -a "Assets:Checking, Assets:Accounts Receivables" -f "amount" -d "timestamp" -n "projectname" -s "../sample_csvs/save.txt"h3. Example File:2011/03/03 * Newsletter Graphics Assets:Checking 105.000000 Assets:Accounts Receivables 2011/03/03 * Newsletter Graphics Assets:Checking 26.000000 Assets:Accounts Receivablesh2. Expenses:./csvToLedger --open="../sample_csvs/expenses.csv" -a "Equity:Expenses, Assets:Checking" -f "cost" -d "timestamp" -n "note" -s "../sample_csvs/save.txt"h3. Example File:2011/02/01 * Equipment Equity:Expenses 150.000000 Assets:Checking 2009/09/27 * Flash Player License Equity:Expenses 100.000000 Assets:Checking 2009/09/27 * SVN Service Equity:Expenses 14.990000 Assets:Checkingh2. The Super Easy Way to Install (Macports) You can install this application using MacPorts! Type the following:sudo port -v selfupdate sudo port install csvToLedgerThis method takes care of all dependancies and can manage updates for you. For information on installing MacPorts, please visit their "site":http://www.macports.org/install.php. h2. Installing: Installing csvToLedger is pretty easy. Because Macs and Linux already include Python, all you need to do is download the csvToLedger source, decompress it, and move it wherever you want. Of course, if you use csvToLedger a lot you might want to "add your installation location to your PATH variable":http://kb.wbpsystems.com/index.php/article/setting-your-path-variable. On Windows, you need to download "Python 2.x":http://www.python.org/download/ and install it before installing csvToLedger. Or install the version of csvToLedger containing Python. h2. Download: Windows (Zip file, Contains Python):"https://github.com/tazzben/csvToLedger/blob/Release_1/dist/csvToLedger_dist.zip":https://github.com/tazzben/csvToLedger/blob/Release_1/dist/csvToLedger_dist.zip?raw=true Windows (Zip file): "https://github.com/tazzben/csvToLedger/blob/Release_1/dist/csvToLedger.zip":https://github.com/tazzben/csvToLedger/blob/Release_1/dist/csvToLedger.zip?raw=true Max/Linux/Etc (tar.gz file): "https://github.com/tazzben/csvToLedger/blob/Release_1/dist/csvToLedger.tar.gz":https://github.com/tazzben/csvToLedger/blob/Release_1/dist/csvToLedger.tar.gz?raw=true
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。