├── .github └── FUNDING.yml ├── .ledgerrc ├── README.md ├── d_ledger └── data ├── assets.ldg ├── budget_example.ldg ├── commodity.ldg ├── equity.ldg ├── expenses.ldg ├── income.ldg ├── journal_example.ldg ├── prices.db └── s_budget.ldg /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: govorenefekt 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: dan_radunchev 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.ledgerrc: -------------------------------------------------------------------------------- 1 | --pedantic 2 | --explicit 3 | --file ~/L/ledger/data/commodity.ldg 4 | --file ~/L/ledger/data/expenses.ldg 5 | --file ~/L/ledger/data/assets.ldg 6 | --file ~/L/ledger/data/equity.ldg 7 | --file ~/L/ledger/data/income.ldg 8 | --file ~/L/ledger/data/s_budget.ldg 9 | --file ~/L/ledger/data/budget.ldg 10 | --file ~/L/ledger/data/journal.ldg 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # my ledger-cli setup 2 | 3 | ### notes: 4 | Configuration file goes to $HOME 5 | Order of loading meta files (in _.ledgerrc_) is important. 6 | d_ledger file to be sourced inside .bashrc 7 | 8 | ### ledger configuration file 9 | - [ledgerrc](.ledgerrc) - Configuration file for ledger 10 | 11 | ### meta files 12 | - [data/assets.ldg](data/assets.ldg) - Assets definitions 13 | - [data/commodity.ldg](data/commodity.ldg) - Commodity definitions 14 | - [data/equity.ldg](data/equity.ldg) - Equity definitions 15 | - [data/expenses.ldg](data/expenses.ldg) - Expenses definitions 16 | - [data/income.ldg](data/income.ldg) - Income definitions 17 | - [data/s_budget.ldg](data/s_budget.ldg) - Budget automation 18 | - [data/budget_example.ldg](data/budget_example.ldg) - Budget definitions 19 | 20 | ### example journal file 21 | - [data/journal_example.ldg](data/journal_example.ldg) - Example ledger 22 | 23 | ### ledger bash aliases 24 | - [d_ledger](d_ledger) - bash aliases and functions 25 | 26 | ## useful ledger links: 27 | 28 | [Plain Text Accounting's Ledger CLI Quick Reference](http://plaintextaccounting.org/quickref) 29 | [Ledger CLI Documentation](https://www.ledger-cli.org/docs.html) 30 | [Ledger CLI cheatsheets](https://devhints.io/ledger) 31 | [Program your Finances](https://www.petekeen.net/finance) 32 | [Report Scripts for Ledger CLI with Gnuplot](https://www.sundialdreams.com/report-scripts-for-ledger-cli-with-gnuplot/) 33 | [Ledger practices](https://felixcrux.com/blog/ledger-practices) 34 | [Accounting for the simple minds with plain text accounting](https://dustri.org/b/accounting-for-the-simple-minds-with-plain-text-accounting.html) 35 | [Envelope budgeting with Ledger](https://rjurga.github.io/2018/05/10/ledger.html) 36 | [Keeping your finances at check with Ledger](https://dzx.cz/2020/02/19/ledger/) 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /d_ledger: -------------------------------------------------------------------------------- 1 | alias led='ledger -X BGN' 2 | alias post='vim "+normal G$" +startinsert ~/L/ledger/data/journal.ldg' 3 | alias assets='ledger b ^assets --flat -X BGN' 4 | alias expenses='ledger r -r assets -s -X BGN' 5 | alias budget='led b budget --flat -p $( date +%b ) -X BGN' 6 | alias balance='led balance --real -X BGN' 7 | 8 | xrupdate () { 9 | curl -s 'https://dskbank.bg/restapi/dsk/GetCurrencyRates?format=json' | 10 | sed -e 's/[{}]/\n/g' -e 's/"//g' | sed -e '2~2d' | 11 | awk -v date="$(date +"%Y-%m-%d")" -F[,:] 'NF && $4!=0{print "P " date" 00:00:00 "$6" "$4 " BGN"}' >> ~/L/ledger/data/prices.db 12 | } 13 | -------------------------------------------------------------------------------- /data/assets.ldg: -------------------------------------------------------------------------------- 1 | account Assets:Cash 2 | account Assets:Euro 3 | account Assets:DSK:Current 4 | account Assets:DSK:Savings 5 | account Assets:DSK:VVisa 6 | account Assets:DSKBank:Other 7 | account Assets:Reimbursements 8 | -------------------------------------------------------------------------------- /data/budget_example.ldg: -------------------------------------------------------------------------------- 1 | 2018-04-01 * Opening Balance 2 | (Budget:Available) 3000 BGN 3 | 4 | 2018-04-01 * Budget 5 | [Budget:Expenses:Books] 120 BGN 6 | [Budget:Expenses:Groceries] 900 BGN 7 | [Budget:Expenses:MealOut] 400 BGN 8 | [Budget:Expenses:Subscriptions] 100 BGN 9 | [Budget:Expenses:Pets] 60 BGN 10 | [Budget:Available] 11 | 12 | 2018-05-01 * Opening Balance 13 | (Budget:Available) 3400.46 BGN 14 | 15 | 2018-05-01 * Budget 16 | [Budget:Expenses:Books] 120 BGN 17 | [Budget:Expenses:Groceries] 900 BGN 18 | [Budget:Expenses:MealOut] 400 BGN 19 | [Budget:Expenses:Subscriptions] 100 BGN 20 | [Budget:Expenses:Pets] 60 BGN 21 | [Budget:Available] 22 | -------------------------------------------------------------------------------- /data/commodity.ldg: -------------------------------------------------------------------------------- 1 | commodity BGN 2 | note Bulgarian Lev 3 | nomarket 4 | default 5 | commodity EUR 6 | note Euro 7 | nomarket 8 | 9 | -------------------------------------------------------------------------------- /data/equity.ldg: -------------------------------------------------------------------------------- 1 | account Equity:Opening Balances 2 | -------------------------------------------------------------------------------- /data/expenses.ldg: -------------------------------------------------------------------------------- 1 | account Expenses:Books 2 | account Expenses:Car 3 | account Expenses:ClothesShoes 4 | account Expenses:CoffeeWater 5 | account Expenses:DSK:Taxes 6 | account Expenses:Entertainment 7 | account Expenses:Gadgets 8 | account Expenses:Groceries 9 | account Expenses:House 10 | account Expenses:MealOut 11 | account Expenses:Others 12 | account Expenses:Pets 13 | account Expenses:Subscriptions 14 | account Expenses:Taxi 15 | account Expenses:Travel 16 | account Expenses:Utilities 17 | account Expenses:Vacation 18 | -------------------------------------------------------------------------------- /data/income.ldg: -------------------------------------------------------------------------------- 1 | account Income:Other 2 | account Income:Salary 3 | -------------------------------------------------------------------------------- /data/journal_example.ldg: -------------------------------------------------------------------------------- 1 | 2018-04-01 * Opening Balances 2 | Assets:DSKBank:Current 1000 BGN 3 | Assets:DSKBank:Savings 1000 BGN 4 | Assets:DSKBank:VirtualVisa 1000 BGN 5 | Assets:Cash 100 BGN 6 | Equity:Opening Balances 7 | 8 | 2018-04-01 * Kenvelo 9 | Expenses:ClothesShoes 161.93 BGN ; тениски, панталони, ризи 10 | Assets:DSKBank:Current 11 | 12 | 2018-04-01 * Made in Blue 13 | Expenses:MealOut 38.6 BGN ; обяд 14 | Assets:Cash 15 | 16 | 2018-04-02 * Bakalia 2014 17 | Expenses:Groceries 18.40 BGN 18 | Assets:Cash 19 | 20 | 2018-04-03 * Employer ; Св. Париций 21 | Assets:DSKBank:Current 1000 BGN 22 | Income:Salary 23 | 24 | 2018-04-03 * ATM 25 | Assets:Cash 50 BGN 26 | Expenses:DSKBank:Taxes 1.2 BGN 27 | Assets:DSKBank:Current 28 | 29 | 2018-04-05 * Internal DSKBank 30 | Assets:DSKBank:Savings 500 BGN 31 | Assets:DSKBank:Current 32 | 33 | 2018-04-10 * Netflix 34 | Expenses:Subscriptions 19.30 BGN 35 | Assets:DSKBank:VirtualVisa 36 | -------------------------------------------------------------------------------- /data/prices.db: -------------------------------------------------------------------------------- 1 | P 2018-06-01 00:00:00 EUR 1.96 BGN 2 | P 2018-06-17 00:00:00 USD 1.7102 BGN 3 | P 2018-06-17 00:00:00 SEK 0.19383 BGN 4 | P 2018-06-17 00:00:00 CHF 1.7117 BGN 5 | P 2018-06-17 00:00:00 JPY 0.015479 BGN 6 | P 2018-06-17 00:00:00 CAD 1.3001 BGN 7 | P 2018-06-17 00:00:00 GBP 2.2584 BGN 8 | P 2018-06-17 00:00:00 EUR 1.96 BGN 9 | P 2018-06-17 00:00:00 HUF 0.006106 BGN 10 | P 2018-06-17 00:00:00 PLN 0.4767 BGN 11 | P 2018-06-17 00:00:00 RUB 0.027786 BGN 12 | P 2018-06-17 00:00:00 RON 0.42199 BGN 13 | P 2018-06-17 00:00:00 TRY 0.36354 BGN 14 | P 2018-06-18 00:00:00 USD 1.7104 BGN 15 | P 2018-06-18 00:00:00 SEK 0.1935 BGN 16 | P 2018-06-18 00:00:00 CHF 1.7167 BGN 17 | P 2018-06-18 00:00:00 JPY 0.015501 BGN 18 | P 2018-06-18 00:00:00 CAD 1.298 BGN 19 | P 2018-06-18 00:00:00 GBP 2.2545 BGN 20 | P 2018-06-18 00:00:00 EUR 1.96 BGN 21 | P 2018-06-18 00:00:00 HUF 0.006099 BGN 22 | P 2018-06-18 00:00:00 PLN 0.4757 BGN 23 | P 2018-06-18 00:00:00 RUB 0.027524 BGN 24 | P 2018-06-18 00:00:00 RON 0.42164 BGN 25 | P 2018-06-18 00:00:00 TRY 0.36396 BGN 26 | P 2018-06-24 00:00:00 USD 1.7039 BGN 27 | P 2018-06-24 00:00:00 SEK 0.19205 BGN 28 | P 2018-06-24 00:00:00 CHF 1.7183 BGN 29 | P 2018-06-24 00:00:00 JPY 0.015505 BGN 30 | P 2018-06-24 00:00:00 CAD 1.28 BGN 31 | P 2018-06-24 00:00:00 GBP 2.2526 BGN 32 | P 2018-06-24 00:00:00 EUR 1.96 BGN 33 | P 2018-06-24 00:00:00 HUF 0.006083 BGN 34 | P 2018-06-24 00:00:00 PLN 0.4728 BGN 35 | P 2018-06-24 00:00:00 RUB 0.027662 BGN 36 | P 2018-06-24 00:00:00 RON 0.42223 BGN 37 | P 2018-06-24 00:00:00 TRY 0.36375 BGN 38 | P 2018-06-25 00:00:00 USD 1.7039 BGN 39 | P 2018-06-25 00:00:00 SEK 0.19205 BGN 40 | P 2018-06-25 00:00:00 CHF 1.7183 BGN 41 | P 2018-06-25 00:00:00 JPY 0.015505 BGN 42 | P 2018-06-25 00:00:00 CAD 1.28 BGN 43 | P 2018-06-25 00:00:00 GBP 2.2526 BGN 44 | P 2018-06-25 00:00:00 EUR 1.96 BGN 45 | P 2018-06-25 00:00:00 HUF 0.006083 BGN 46 | P 2018-06-25 00:00:00 PLN 0.4728 BGN 47 | P 2018-06-25 00:00:00 RUB 0.027662 BGN 48 | P 2018-06-25 00:00:00 RON 0.42223 BGN 49 | P 2018-06-25 00:00:00 TRY 0.36375 BGN 50 | P 2018-06-27 00:00:00 USD 1.7043 BGN 51 | P 2018-06-27 00:00:00 SEK 0.1915 BGN 52 | P 2018-06-27 00:00:00 CHF 1.7165 BGN 53 | P 2018-06-27 00:00:00 JPY 0.01552 BGN 54 | P 2018-06-27 00:00:00 CAD 1.2807 BGN 55 | P 2018-06-27 00:00:00 GBP 2.2422 BGN 56 | P 2018-06-27 00:00:00 EUR 1.96 BGN 57 | P 2018-06-27 00:00:00 HUF 0.006047 BGN 58 | P 2018-06-27 00:00:00 PLN 0.4711 BGN 59 | P 2018-06-27 00:00:00 RUB 0.027665 BGN 60 | P 2018-06-27 00:00:00 RON 0.42238 BGN 61 | P 2018-06-27 00:00:00 TRY 0.37064 BGN 62 | P 2018-10-02 00:00:00 USD 1.7205 BGN 63 | P 2018-10-02 00:00:00 SEK 0.19089 BGN 64 | P 2018-10-02 00:00:00 CHF 1.7455 BGN 65 | P 2018-10-02 00:00:00 JPY 0.015149 BGN 66 | P 2018-10-02 00:00:00 CAD 1.3423 BGN 67 | P 2018-10-02 00:00:00 GBP 2.2197 BGN 68 | P 2018-10-02 00:00:00 EUR 1.96 BGN 69 | P 2018-10-02 00:00:00 HUF 0.006094 BGN 70 | P 2018-10-02 00:00:00 PLN 0.4754 BGN 71 | P 2018-10-02 00:00:00 RUB 0.026972 BGN 72 | P 2018-10-02 00:00:00 RON 0.42154 BGN 73 | P 2018-10-02 00:00:00 TRY 0.30246 BGN 74 | P 2018-10-05 00:00:00 USD 1.7227 BGN 75 | P 2018-10-05 00:00:00 SEK 0.19048 BGN 76 | P 2018-10-05 00:00:00 CHF 1.734 BGN 77 | P 2018-10-05 00:00:00 JPY 0.015132 BGN 78 | P 2018-10-05 00:00:00 CAD 1.3394 BGN 79 | P 2018-10-05 00:00:00 GBP 2.2314 BGN 80 | P 2018-10-05 00:00:00 EUR 1.96 BGN 81 | P 2018-10-05 00:00:00 HUF 0.006078 BGN 82 | P 2018-10-05 00:00:00 PLN 0.4746 BGN 83 | P 2018-10-05 00:00:00 RUB 0.026488 BGN 84 | P 2018-10-05 00:00:00 RON 0.42109 BGN 85 | P 2018-10-05 00:00:00 TRY 0.29612 BGN 86 | -------------------------------------------------------------------------------- /data/s_budget.ldg: -------------------------------------------------------------------------------- 1 | account Budget:$account 2 | account Budget:Expenses:Books 3 | account Budget:Expenses:Groceries 4 | account Budget:Available 5 | account Budget:Expenses:MealOut 6 | account Budget:Expenses:Subscriptions 7 | account Budget:Expenses:Pets 8 | account Budget:Expenses:Utilities 9 | account Budget:Expenses:ClotesShoes 10 | 11 | = /^Income/ 12 | (Budget:Available) -1.0 13 | 14 | = /^Expenses:(?=Pets|Books|Groceries|MealOut|Subscriptions|Pets|Utilities|ClotesShoes)/ 15 | (Budget:$account) -1.0 16 | 17 | = /^Expenses:(?!Pets|Books|Groceries|MealOut|Subscriptions|Pets|Utilities|ClotesShoes)/ 18 | (Budget:Available) -1.0 19 | --------------------------------------------------------------------------------