Wow. Others exist!

For some strange reason, I have only found things like eekboek in previous apt searches, but today I found a whole family of plain text accounting systems! I'm elated!

This format is similar to the one I've been using, which I built on git and bash, (with gawk, sed, cut, etc. and some perl in testcases.) I based it on my highschool textbook, and Internet research for things beyond that. It was made to be customizable to the situation, widely portable, supporting collaboration and whatever else needed. It has a template system, supports multiple accounting systems in complex ways, and has minimal carryovers from my previous binary system in VBScript/JScript. (It was made after a worksheet spreadsheet and my very simple QBasic 1.0/machine code auction handler; and yes, my username draws heavily from the name QBasic.)

The ledger tools seem to be able to do most of what my system does, and more, and scripting seems easy enough that I could add what little is missing, I'm almost sure. I am hopeful these tools are at least as stable as my own, and am considering migrating to the ledger format. I guess I'd like to just go over migration strategy, a bit, and maybe try it next year, so I don't screw up end-of-year stuff. Any advice is welcome!

My format organizes each system into a namespace that has a single general controlling account and metadata such as document number format. In ledger, I would just use the controlling account, and metadata could be handled somehow, I am pretty sure.

My system only uses namespace (either in a file header or otherwise specified) and id, title or alias to reference an account, rather than the fully qualified controlling account path. It seems ledger can do this with aliases, but I would have to be careful of name conflicts, so the namespace controlling account would be necessary if mixing systems. (I think most mixing would be done via the link keyword.)

I believe both formats have an arbitrary number of files, organized as desired. I typically use one chart of accounts, and multiple journal files. I like how ledger can selectively include files. I wanted to do that intuitively in my system, to improve efficiency, but never got it completely worked out.

My chart of accounts is typically in its own file to make listing them more efficient. After the namespace header, each account has properties, special classification, controlling account, title, id (account number or short name,) and aliases, and it's hard-wired for what ledger calls strict mode. I think the account keyword does some of this, at least, and ledger has a similar file. I don't know if it is text or binary, though.

My temporary accounts have closing entries generated on-the-fly to a specified closing account at whatever fiscal period is currently in effect after all files are read. I don't know if ledger can do something like that. (I use yearly cycles for tax purposes, but some also use monthly for normal worksheets and reports.)

My journal files begin with the namespace header, then are separated by month, typically in order. Entries are roughly in order for each month. They contain the day of the month, the description, and metadata like document numbers on the first line. Postings follow until another line beginning with a date. This isn't too far from the ledger format.

Posting format without a template is slightly different from ledger, but I've wished I had done it differently for a while. I like ledger's better. The only advantage mine has is that the entry is guaranteed to balance.

I have a balance check feature, which can be done with a =balance keyword, apparently. My system is more complicated, I expect, due to some files being read in different orders, depending on parallelization or OS differences. Sometimes it happens after all files are read, and other times as they are read to error out faster.

Comments begin with # in my files, and ; in ledger files, from what I've seen. My files don't allow comments on the description line. I don't know if ledger does.

I have ways of specifying unknown information. Unknown categories are handled with a special account that should ideally have 0 balance, which apparently is also what ledger users do. I don't know how it handles other unknowns, like date or amount.

Template syntax for ledger apparently depends on the flavor of tool and such. I can always unpack the template, if needed, but I would prefer something like either my original binary solution (supporting specialized journals) or my current one, (which was intended to allow customization of everything but the date, though it's not finished. It mostly just fills in defaults. I have one journal that is full of only dates, with a few template definitions in between where the price changed or whatever.)

Some of my journal files are marked read-only because they are overwritten by a generator, and should not be edited by other tools.

I import ofx/qfx/qbo (preferred) and csv/tsv files, and also have tools for qif and others that I don't use anymore. Auto-correcting is done for certain formats from certain banks. Auto-matching is done by comparison with already matched entries, custom matching code from namespace metadata, and optionally choosing the best scoring match or asking. It seems the ledger family does this too, maybe?

Anyway, I intend to play around with one or both ledgers, hledger, and Beancount to see how they work and then I will probably try using one or more of them simultaneously with my system to see how it goes next year. Maybe this is more appropriate in a blog or something, now that I think of it...

Anyway, it was a pleasant surprise to see others like-minded. I originally had the intention of putting my system on GitHub, someday, but it's never finished like I want and some testcases and tools may have non-public information in history I would need to purge. I've never made money with it, and only shared it with or used it for family. If anyone is interested in something I have that ledger may not, I probably wouldn't mind contributing it, if it would be useful.

4 Likes

Welcome @Quasic! Congrats on your system which sounds impressive.

While digging into the other PTA apps, you may be interested in some of the technical specs here: https://plaintextaccounting.org/#other-features

1 Like

Thanks, @simonmic for the link! I also found hledger and Ledger - hledger very helpful.

While trying this migration out, I am noticing more differences. Some are a bit confusing. (I've found some answers, and will start new topics for the rest...) Other differences are manageable, but interesting. I am still figuring out how ledger and hledger work, so please correct me if I'm wrong about something. The following do not really warrant topics of their own, in my opinion, so I'm posting them here.

One interesting difference is how commodities and values are handled. In my system, commodity/currency is a property of the account, usually inherited from the namespace. (Format and denominator are properties of the namespace, and though they may be overridden along with the commodity, I don't have much support for it in practice. I usually think of values as either fixed-point numbers or smaller units of currency.) If multiple commodities need to go into one account, I use subaccounts. Values are handled as integer counts of the smallest unit of precision, even in floating-point variables, until they are displayed. Dollars are converted to cents, hours to minutes or seconds, depending on granularity, etc. For display, each value is actually a fraction, but the denominator is a property of the commodity, rather than part of the value, so yeah, fixed-point or converted unit.

(h)ledger handle commodities as basically hidden subaccounts, under the hood, from my perspective, it seems. Format is properly a commodity property, but denominator is part of the individual value in ledger. (I am not sure if hledger does it in a way that is closer to mine.)

Another difference is how we handle spaces in account names and things. (h)ledger use 2+ spaces/tabs after accounts. (ledger also allows single tabs.) I used a tsv format for the whole file, so I am migrating towards ledger's separators. Tabs are good for some things, but can be cumbersome when trying to use tab-completion.

I originally tried to get into ledger's lot notation, but I think it is too much for me at this point. I was glad to learn that hledger ignores it.

ledger has various parts that work together, as my system does, though the parts are arranged differently, perhaps. ledger's unit test method is similar to some of mine. It's fun to see how others have handled similar things. I might put some of my tools converted to ledger format on GitHub, if I don't find better solutions already exist.

Yes, in Ledger and hledger commodity is primarily a property of amounts, and any account may hold any mixture of such amounts. (hledger calls it a MixedAmount, contrasting with a single-commodity Amount.) I think beancount might restrict each account to a single commodity.

And, in all three the amounts are effectively decimal numbers with arbitrary precision (though the internal representations and limits differ). None of them model commodities' minor unit (smallest quantity), AFAIK.

https://hledger.org/dev/hledger.html#other-costlot-notations might be of interest. Ledger's lot syntaxes are complicated and underdocumented. Beancount's is well documented.

1 Like

I think I may keep it to one commodity per account, for now, to be safe and simple.

Arbitrary precision is better, in general. When I have rare transactions involving, say, splitting a cent into parts, I manually use an account understood to be "shared" by the other accounts. Normally, here, transactions are already rounded to the minor unit before I record them, so I preferred this way for my use case, but appreciate that nobody else does it. :wink:

Thanks for the info!