News for hackers. Stuff that matters.
Re:Plain Text Accounting by OskarS on Tuesday January 12, 2021 @09:28AM (#25747297)
I can really recommend doing this for your personal finances! Tools like ledger are really powerful, and properly accounting is a great way to save on money. I can very easily go into my personal ledger and (say) get a report on "How much money did i spend daily on groceries last month" or "List all subscription services i pay for and how much they cost each month" or whatever. It gives you a great view into where your money is going and helps you plan for the future. It's very satisfying to run the command "ledger reg -Mn Assets Liabilities", which is "show me my net wealth (i.e. the sum of Assets and Liabilities) for every month in the ledger", and see your personal wealth grow over time.

But almost more importantly: if you're a programmer, it's really very fun! Like, i have my own system where I download my bank statement as a CSV and process it in AWK together with an org-mode table of payees that map each line on the bank statement to an account, which then generates a ledger file. Since it's just you using it, you can make it so it works however you like, and it quite satisfying to see it all come together.

It's also a great way to learn about accounting. Turns out, I really kinda like accounting! It has many of the same pleasures of programming or math, and seeing everything balance is very satisfying. In short: if you're a programmer who feels like they haven't quite got a handle on their finances, I can't recommend plain text accounting highly enough.

Re:Plain Text Accounting by EvanAnderson on Tuesday January 12, 2021 @11:28AM (#25749093)
Besides having a solid payoff for your personal finances, a 100-level knowledge of bookkeeping and accounting, I'd argue, confer near "super powers" when it comes to dealing with finance and accounting people. Bookkeeping is one of the oldest and longest-practiced IT disciplines. Your work probably touches revenue / expenses for your employer and someday you'll need to interface with accounting or finance people. Being able to speak the language, even poorly, has helped me gain trust and credibility that I don't believe speaking only in IT terms would have.
Re:Plain Text Accounting by bradleybuda on Tuesday January 12, 2021 @12:54PM (#25750557)
I took this course about three years ago (which, coincidentally, starts today!) and I completely agree - a basic knowledge of bookkeeping is an incredibly handy skill in all sorts of real-world situations:

https://www.coursera.org/learn/wharton-accounting

Re:Plain Text Accounting by zenlot on Tuesday January 12, 2021 @01:21PM (#25751073)
Most of the Coursera courses "starts today". Check tomorrow, you'll still see the same message.
Re:Plain Text Accounting by tsjq on Tuesday January 12, 2021 @11:55PM (#25758342)
How do they manage it possible ?
Re:Plain Text Accounting by deathtrader666 on Wednesday January 13, 2021 @06:01AM (#25760535)
These must be pre-recorded, available on-demand.
Re:Plain Text Accounting by gen220 on Tuesday January 12, 2021 @12:45PM (#25750420)
Big plus one. Especially if your software work is even remotely finance-adjacent.

The moment I start talking in terms of liabilities, virtual accounts, etc. their eyes light up!

Incidentally, Accounting and Software have a lot in common. They both build and apply abstractions to the "real world" (flipping-bits), in order to give the abstraction-wielder more power and insight.

Re:Plain Text Accounting by datavirtue on Tuesday January 12, 2021 @01:19PM (#25751032)
I second this. Accounting training enabled me to break my siloed attachment to IT and become a valuable asset to finance and accounting groups as well. Since they controlled all of the money they would come me to me discretely to get information and feasibility assessments on hardware purchases and development projects. At a small company this effectively made me the CIO's #1.
Re:Plain Text Accounting by mikepurvis on Tuesday January 12, 2021 @12:24PM (#25750052)
> How much money did i spend daily on groceries last month

Can you expand on this slightly? One of my frustrations with personal finance tools that I have tried in the past is that they're really bad at modelling occasional expenses— for example as a low-car family, we only fuel our vehicle once every 4-5 weeks, so some months the "gas budget" goes unused, whereas other months if we take a trip, we'll completely blow the gas budget because we fuel up twice or three times.

I wish it were possible to "smooth" those kinds of expenses into an average daily amount, but also have a way of indicating that a particular chunk of them should actually be extracted from the smoothing and assigned to a different category altogether (eg, the gas used on the trip should go to "vacations", not "vehicle"). A similar thing applies with other bursty things like home repair expenses, where I'd like my Home Depot receipts amortized over a time period that I specify rather than counted right at the moment of purchase.

Re:Plain Text Accounting by samatman on Tuesday January 12, 2021 @02:01PM (#25751691)
With ledger, this is very easy.

I also run a janky Python script which imports my various .csv files, detects which is which, and turns them into ledger entries.

So a vacation stop at a gas station would look like this:

    2021-01-01 Chevron
    Assets:Checking   $-100.00
    Expenses:Auto:Gas
So lets say I know I spent $40 of that on food, and want to put another $40 into the vacation budget, I modify like so:

    2021-01-01 Chevron
    Assets:Checking   $-100.00
    Expenses:Food     $40
    Expenses:Vacation    $40
    Expenses:Auto:Gas
And it puts the rest in the gas budget.

There are ways to report average expenditures and smooth them out, ways to report how many days between each purchase in a particular category or from a particular merchant, and so on. Want to amortize a particular purchase? No problem, it's a periodic transaction.

ledger-cli can do accounting, really if there's a question about your money or a way you want to keep track of it, it's covered. Several graph libraries can ingest ledger files.

Re:Plain Text Accounting by pc86 on Tuesday January 12, 2021 @01:43PM (#25751418)
Well, whether you assign the expenditure to vacations or vehicle is a choice (and I could see arguments for both). So software isn't going to help you with that.

I use YNAB for budgeting and they basically advise what you're requesting - figure out what the "average" is over a given period of time and just budget that amount. Say you contribute $200/mo to an all-encompassing gifts budget, you may only pull from it a few times a year but the money is already earmarked.

Amortizing things doesn't make sense for a home budget - the whole point is to know whether or not you have enough money for x.

Re:Plain Text Accounting by yidaman on Tuesday January 12, 2021 @01:03PM (#25750706)
What I do is I create a budget for an entire year. That smooths out expenses that don’t happen on a monthly cycle.
Re:Plain Text Accounting by davchana on Tuesday January 12, 2021 @12:35PM (#25750217)
I use a spreadsheet, two adjacent columns, one for incoming, one for spending. The column pair is titled as Gas, Registration, Repair. I look back at 1 year history, average those per paycheck, put money in each column from each paycheck. I minus them when I spend. Each row starts with the dare of transaction.
Re:Plain Text Accounting by gen220 on Tuesday January 12, 2021 @12:56PM (#25750599)
> modelling occasional expenses

I would say it's very hard to budget for bursty things on a monthly cadence. You can have a "virtual account" for this stuff, that fills on months with little activity and drains on months with more activity. But this is kind of complicated and might not be worth it.

I'd try answering the question: what is your goal in budgeting for gas, for example? Is it to keep gas spending under control? Or to understand how much you spend on gas? And if you want to understand, why? Budgeting is a solution to some answers to these questions, but not all of them.

Personally, I find it more useful to track these things, than to budget them, if that makes sense.

For example, I want to know how much I spent on rental cars in 2020, because that impacts our decision to lease a car in 2021.

> a way of indicating that a particular chunk of them should actually be extracted from the smoothing and assigned to a different category altogether

In GNU Ledger, you can apply arbitrary categories to each expense, and you can also "tag" line-items. For example, if you think 80% of your last refill was from a trip, you can do as follows:

  20201/01/12 * Chevron
    Expenses:Travel:Car:Gas             $16.00 ; :vacation:
    Expenses:Travel:Car:Gas              $4.00 ; :commuting:
    Liabilities:CreditCards:AppleCard  $-20.00
You can then do queries to see which of your gas came from commuting, and which came from vacation.

You can remove vacation from your reports altogether, and you can also focus exclusively on each vacation. You can even tag vacations, if you so choose.

  ; :vacation:lasvegas2021:
> amortized over a time period that I specify rather than counted right at the moment of purchase

You can achieve this behavior by specifying "effective dates" for certain purchases.

For example, when I buy plane tickets, I like to amortize the cost of that ticket over each day I'm at my destination (similar to your home depot example).

  2020/01/11 * American Airlines
    ; three-day trip to Colorado
    Expenses:Travel:Plane          $80.00  ; [=2020/02/01]
    Expenses:Travel:Plane          $80.00  ; [=2020/02/02]
    Expenses:Travel:Plane          $80.00  ; [=2020/02/03]
    Liabilities:CreditCards:Apple $240.00
The dates in the comment are called "Effective dates". You can ask for reports to be presented with either effective dates or transaction dates, at query-time. Note that the credit card payment's effective date is identical to the transaction date.

Let me know if you have any further questions! It's a fun topic.

Re:Plain Text Accounting by smichael on Tuesday January 12, 2021 @02:09PM (#25751822)
Remove the `=` and you don't have to choose!
Re:Plain Text Accounting by smichael on Tuesday January 12, 2021 @12:36PM (#25750239)
I had the same wish, you might be interested in https://github.com/simonmichael/hledger/blob/master/bin/hled...

However, reporting average expenses is easy, and sometimes enough..

Re:Plain Text Accounting by gen220 on Tuesday January 12, 2021 @09:43AM (#25747503)
I think myself and many others could have written the same comment.

I’ll add that it’s also delightfully easy to get started.

As an application, Accounting is kind of like Vim or Excel or other tools with steep learning curves and nirvana at the end of them.

You can start by just tracking one bank account by hand which is easy enough and fun, because you’re still learning how this accounting thing works.

Pretty soon you’ll be tracking your investments, ISOs, taxes, credit card points, and so on as absurdum. You’ll be the person who finds the bug in your employer’s W-2 generator...

It’s a steep time investment, but once you’ve written the automations, it’ll take you maybe 30 minutes each month. And you’ll never experience the feeling of “not being in control” of your finances again.

Re:Plain Text Accounting by wasdfff on Tuesday January 12, 2021 @11:47AM (#25749441)
Do banks have anything you can use to automate getting data off their websites? My annoyances lie in generating the csv files. My checking account outputs an arbitrary range of dates, however many transactions fit on pg 1, while my credit card from the same bank outputs csvs by billing cycle. It makes it a little annoying going into the bank website and generating these files across relevant date ranges.
Re:Plain Text Accounting by gen220 on Tuesday January 12, 2021 @11:56AM (#25749649)
In my experience (USA), most banks will give you the option of downloading a CSV for the last two years of transactions. Beyond that, it’s a challenge.

Some investment brokers will only give you PDFs with tables in them. But there are some pretty amazing libraries for converting these into CSVs, that have worked well for me.

Some people use plaid, but I didn’t like the idea of introducing a middleman-dependency.

What I’ve been doing over time is downloading all of the raw transaction history I can get, and storing it in a git repo. Each month when I “top it off”, I just use git add -p to add only the latest bits. The most annoying part is when they change their CSV format on you (Chase did this recently) and you need to reformat all of your historical data to match.

Re:Plain Text Accounting by adamnew123456 on Tuesday January 12, 2021 @04:41PM (#25754215)
Maybe your bank is better about this and offers OFX, but ultimately I gave up on this approach due to my bank adding more aggressive anti-scraping measures over time. The credit card sites were even worse about this.

Now I have a Postfix server setup which accepts the daily transaction summaries they send and makes CSVs out of those. There's still some HTML munging involved but I've found it much easier to let the data come to me than to go out and try to fetch it myself. In my experience financial institutions simply don't have a lot of reliable automation options accessible to the normal consumer.

Re:Plain Text Accounting by sundarurfriend on Tuesday January 12, 2021 @01:02PM (#25750699)
> Do banks have anything you can use to automate getting data off their websites?

There's an Open Financial Exchange (OFX) standard that's supposed to be for this, I think. I came across it when someone mentioned the ledger-autosync [1] tool that tries to use it to get your data from your bank automatically. If I understand correctly (no guarantee on that), this automation would work for institutions listed here [2].

[1] https://github.com/egh/ledger-autosync [2] http://www.ofxhome.com/index.php/home/directory/successfulRe...

Re:Plain Text Accounting by jonathanoliver on Tuesday January 12, 2021 @10:16PM (#25757587)
I just got started using the ofxget command in the ofxtools package. It was a simple "pip install --user ofxtools". After that, I read some of the docs for ofxget and configured these with the settings from ofxhome.com and I've got automated ability to pull in my transactions for credit cards, checking accounts, and even long-term investment accounts. It's really cool to interact at this low level because there's so much control compared to QuickBooks/Quicken.
Re:Plain Text Accounting by chrislloyd on Tuesday January 12, 2021 @03:49PM (#25753402)
I've found being "fun for programmers" to be undervalued. Using Ledger is fun, which has caused me to spend more time thinking and understanding my personal finances which have in turn improve my personal finances. I haven't cared as much using less hackable tools.
Re:Plain Text Accounting by uryga on Tuesday January 12, 2021 @06:19PM (#25755426)
same! apparently i tricked myself into caring about my finances in this exact way
Re:Plain Text Accounting by js2 on Tuesday January 12, 2021 @10:08PM (#25757532)
> properly accounting is a great way to save on money

The submitted page links back to a previous discussion on HN:

https://news.ycombinator.com/item?id=12119050

Funny enough the top comment on that discussion concludes:

> I now focus my efforts on income expansion rather than cost control. Some of you may say, recording costs is not controlling it. In that case, I find accounting, even less useful (once I have arrived at approximate cash outflow). Income expansion, puts me in a different frame, which I find strangely empowering. Even more so than the satisfaction that comes from having controlled costs.

Re:Plain Text Accounting by corytheboyd on Tuesday January 12, 2021 @03:32PM (#25753144)
I’ve been waiting for the perfect reason to start running my finances like I run the other things I enjoy, and this might be it. If I can make it fun, I think I could stick to it. I’ve tried some of the apps and... I just don’t get enough out of them to warrant throwing that much of my sensitive data at them for free... in fact summarizing it here makes it sound insane. Thank you kind hacker news commenter for sharing your wisdom :)
Re:Plain Text Accounting by OskarS on Tuesday January 12, 2021 @04:33PM (#25754087)
This is another excellent reason for using ledger: you are in total control of your financial data. It’s just text-files, you don’t have to share them with any service, they are not in some weird binary format, and you can use standard tools like git to work with them if you want. You can also collect all the information from every financial service you interact with (banks, credit unions, credit card companies, brokerages, whatever) in one place and get reports on all of them at the same time. It’s the bee’s knees!
Re:Plain Text Accounting by tarsinge on Tuesday January 12, 2021 @02:42PM (#25752342)
I agree with the fun part. I found this to be a nice intro to the concepts of double entry accounting: https://martin.kleppmann.com/2011/03/07/accounting-for-compu...

Previous HN submission : https://news.ycombinator.com/item?id=2298471

Re:Plain Text Accounting by npsimons on Tuesday January 12, 2021 @02:18PM (#25751973)
I used to used GNUCash heavily with double-entry bookkeeping; nowadays I use org-tables' spreadsheets functionality. I've also done a bit of tax calculation using CL, and always meant to look into ledger, and it sounds like it might fit the flexibility requirements I have come to (ab)use in org-mode.