git ssb


cel / ledger-scripts


Charles Lehner committed Update readme. Add Contributing sectionLatest: ac0d1af on 9/18/2016, 11:34:14 PM


A collection of scripts for helping to organize one's finances using ledger, with a focus on crypto-currencies. They are implemented variously in Shell, Awk, and Perl.

© 2013-2016 Charles Lehner, MIT License

Data import scripts

Convert transactions from various CSV formats into Ledger format.


Import LocalBitcoins transactions into ledger.

Parses the "Completed Contacts" CSV file. Automatically calculates the missing fee.


Import Fidelity transactions

Handles commodities/funds properly.


Import Mint transactions.

Combines transfers between accounts, and allows for arbitrary renaming of transactions.


Import transactions from a Dwolla statement.


Import MtGox trading history.

Reads both the USD and BTC CSV files exported from Mt.Gox.

Does not combine corresponding withdraw fees and withdraw debits.


Import BTC-E trading history. Incomplete, but may be useful for a start.

Reads data that you copy and paste from BTC-E's Transactions history table.


Import transaction history from an Electrum wallet.

Reads a CSV file exported from Electrum.


Import transactions from a export.


Import transactions from a Havelock Investments account.


Import transaction history for a CampBX account.


Import transaction history for a Crypto-Trade account.

To obtain the TSV data to import, visit the transactions page, and for each page of results, copy and paste the table into a text file such that each row from the table is in its own line, with the values in the cells separated by tabs.


Import full PayPal CSV transactions history (including shopping carts). Currently this script is buggy so the results have to be manually fixed.


Import Ethereum transaction history for an address, using's API. Depends on jq.


Two scripts are provided for processing two types of CSV files that Coinbase exports. For best results, run both, merge the results, and then reconcile it with the online transaction history.

Import transactions (Coinbase-Transactions-Export...csv). This contains every buy, sell, send and receive in the account, but the fee amounts for the buy and sell transactions are not always provided, and the BTC amount for buy and sell transactions is not always accurate. The bitcoin transaction IDs are usually included.

Import transfers/trades (Coinbase-Transfers-Export...csv)

This one has full fee details and exact BTC amounts for each buy/sell transfer, but does not include other transactions sent and received from the account.

More scripts

Get quotes for various stocks, currencies, and commodities. Written in Perl and depends on some perl modules.


BTC, altcoins, gold, silver, Havelock Investments, CryptoStocks, NASDAQ, and sovereign currencies.

Get quotes for things. Written in POSIX shell. Depends on curl and jq. Currently it does not support as many tickers as does.


Get past quotes for BTC/USD, using BitcoinAverage's API.


Detect transactions in incoming emails through the Claws Mail client and write them to a ledger journal.



Merge multiple ledger journals into one, in roughly time order. It prompts you to merge transactions between journals that might be the same.

Not completely working


Merge multiple ledger journals into one, in time order, without detecting duplicates.


Retrieve accrued interest on US Treasury savings bonds. This script queries the Savings Bond Calculator on the TreasuryDirect website and looks up the difference in total value of some bonds between two dates. To use the script you have to set an environmental variable BONDS_QUERY to the query string you would submit to the savings bond calculator. To figure out what value to use for the query string, do the following:

TODO: automate more of this

Similar projects


Contributions are very welcome. Here are some possible things to do:

Built with git-ssb-web