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 blockchain.info 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 etherscan.io'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
Import transfers/trades (
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.
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
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.
Dividends received from Havelock and Cryptostocks.
Payments sent from Paypal, Dwolla, and Coinbase.
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:
- Go to the Savings Bond Calculator page
- Add the bonds using the form
- Right click somewhere in the form and choose "Inspect Element" to open the web inspector
- Find the
<form>element in the web inspector
- Change the
methodattribute of the
- Close the web inspector
- Submit the form using the View or Save button
- Get the URL of the resulting page. Copy the query string starting at
- Set the env var to the copied query string e.g. by executing
- Now you can run the script, e.g.
ust-bonds-interest 11/2015 12/2015to get interested accrued between 11/2015 and 12/2015.
TODO: automate more of this
Contributions are very welcome. Here are some possible things to do:
- Fix bugs
- Increase portability
- Add more scripts
- Add more ticker sources for getquote
- Improve documentation
- Add man pages
- Something else
Built with git-ssb-web