We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
System Crafters · 3.6K views · 99 likes
Analysis Summary
Ask yourself: “Did I notice what this video wanted from me, and did I decide freely to say yes?”
Worth Noting
Positive elements
- This video provides a practical, hands-on demonstration of how to integrate professional accounting principles (GAP) into a plain-text, developer-centric workflow.
Influence Dimensions
How are these scored?About this analysis
Knowing about these techniques makes them visible, not powerless. The ones that work best on you are the ones that match beliefs you already hold.
This analysis is a tool for your own thinking — what you do with it is up to you.
Related content covering similar topics.
A Year Without Vertico - System Crafters Live!
System Crafters
Embedding Scheme in C Apps with Chibi - System Crafters Live!
System Crafters
Declarative UIs in Emacs with vui.el - System Crafters Live!
System Crafters
Zellij Revisited: Crafting Project Layouts - System Crafters Live!
System Crafters
Transcript
Heat. Heat. N. Hey. Hey. Hey. [Music] What's up everybody? Welcome to System Crafters Live. I'm David Wilson and we're back again with another Friday stream where we get together as community and talk about whatever topic that I was just writing up the show notes for at the very last second. Um, and this week is no exception. So, hello, welcome. Nice to see you all here on Friday evening. At least it's evening my time. Probably for many of you it's morning. Um, sorry, but I guess you know Friday's a good day. So, it's not like it matters too much that it's Friday morning for you because it's going to be kind of well I hope it will be a chill day and you're looking forward to the weekend. Uh I'm closer to the weekend in that regard, but uh you know, still it is what it is. So, that went a little bit vague at the end. So, let's see. Let me say uh hello to the people who are here so far. Let me know if you see any uh kind of issues with the um stream quality or anything as well. I literally just got this the thing set up and sometimes stuff goes wrong. Hello to Pi the Sailor Big Eyee Case Oslo. Uh let's see. Gun. I think that's all the people that I've seen so far on the IRC side. I see Inar Ebeam and Beach joining but not saying anything yet. Um hello to Fikree Paul and Mike over on the YouTube side. Glad to see you all. Uh, Biggie is saying that I'm going to go over the generally accepted accounting practices, GAP. I bet you didn't think I knew that, did you? It's not that special, I guess, of a uh uh an acronym. It's just, you know, one of those acronyms you run into whenever you start dealing with accounting, which, you know, sometimes I have to do. So, you know, this um topic of accounting is from the outside you think accounting that's just boring. Like why would you want to talk about accounting? But have you ever really looked into double entry bookkeeping? It's kind of interesting actually. It's it's kind of cool. I like it. Um we'll see if you do too. I don't know. Um we won't really get into like the the nuts and bolts of double entry accounting on this stream. uh but I will tell you enough about sort of like the model of ledger and the associated you know mode and alternative program H ledger that you would sort of understand um basics of what you need to do in in a program like this to manage your accounting either for personal or business purpose which I think is kind of cool. K says I prefer Old Navy. the Old Navy. Prefer it to what? K says, "I use bean count for like two years. Eventually, I just got tired of it." Um, is that the interface on top of each ledger? Of course, I didn't never use the data to like do anything. Yeah, you kind of need to use the information. GAP versus Oh, come on, man. Dad jokes. Dad jokes. Your way to the CPA using Ledger and Geeks. Is that an alternative uh stream title gun? Your way to the CPA using Ledger and Geeks or alternative title, your way to get laughed at by your accountant whenever you show up with Ledger files instead of uh QuickBooks files. Bean count is a Python rewrite rewrite more like a port or whatever. Uh yeah, this idea of plain text accounting is um I don't I don't know if I'd say popular, but it it is sort of well understood at this point. We'll talk about that too. Chimcha says, "Looking forward to the stream. I use GNU cash for budgeting, but have been looking at the ledger for some of its simpler reports." reports. Yeah, I want to look at reports uh while we're looking at this as well cuz um reports are interesting. Well, let me let me see how I want to say this. Yes, exactly. Case, that's a great website. So, um like Case says, you spend a lot of time putting information into a um an accounting tool. really what you want is to get something out of that. So, one of one of the things you can get out of that is just having like a breakdown of all your income and expenses for taxes, especially if you run a business. Um, it's really important to have all that stuff dealt with uh in a uh in an organized way so that you can do your taxes effectively because it's a lot more important to do your um your accounting correctly if you if you have a business. Um if you're just doing it for yourself, it's more like for budgeting, I guess. I mean, it's for it's for taxes, too, but you usually don't have to like break down your expenses very much unless you don't take the standardized deduction and things like that. I'm not going to get into all the accounting business here. Um, basically what I'm trying to say is for personal accounting, really what you're doing is trying to stick to a budget in a lot of cases. Uh, but for business accounting, you're really trying to like strictly keep track of your uh income, expenses, and liability liabilities and all that stuff. So, it's useful for those things. You definitely want to have reports that you can generate that uh gives you the breakdown of different ways to look at that information. And that's one of the things that uh you get out of a tool like Ledger and other plain text accounting tools is it gives you the ability to generate reports which uh kind of boils up the information for you which is good. All right. So John says can ledger be compiled to WAM next video series because I don't want to do it. Well, why would we want to compile it to Wom? But yeah, I think uh I would imagine even right now you could probably compile Ledger to was using mcripton because it's a C program. I think what is Ledger written in? I'm I'm getting way off track here. Um, Wikipedia ledger program written in C++. Presumably, you could uh compile this to the web with incripting. So, yes, we could already do that probably. Um, but you just need to have an interface on top of it of some sort. C++ according to plain textaccounting.org. Hey, hey, uh Alejandra. Okay. Anywh who, let's just get into the the news first because I'm getting off track. Um first of all, the spring loop game jam is almost here. It starts on May 9th. That's about a month away. It's a 10day uh game jam uh which is basically an event where uh multiple people come together to make a game, not necessarily from scratch. There's some rules where you could, you know, continue working on an existing game that you have or a new one from scratch, whatever you want, but the main rule being that you must use a lisp language of some sort, even one that you've created yourself. So, um it's a really fun event. I've done it a few times now. Uh I'm going to I think I'm going to participate. I'm pretty sure I'm going to participate. I'm going to live stream um some of what I do on the project. Um, I I kind of know what I'm going to do, but I haven't really um fleshed out the ideas just yet. But we'll talk about that as as time gets closer. But it's a fun thing to do and uh sort of excuse me, have a way to work on a fun project along with people from the community. So, Big says resurrecting the flux harmonic. Probably not. I know the last time I did the game jam, I did it on uh this channel. I might do that again because we'll be using Guile um and we'll be doing stuff that is pretty similar to what we've been doing on the Crafter Hour streams. So, so yes, uh I definitely recommend joining the Springless Game Jam if you have any issues or if you have any u interest in writing a game with a lisp because it's a lot of fun, you know. And if you are trying to learn a new come on case guy, get good common lisp. know, maybe we'll look at common list at some point, but uh I'm having fun writing GA right now, so I don't really have a reason to go use uh that crusty old uh committee driven standardizes language. Just kidding. FA is not here to yell at me. So yes, join the Spring Loops game jam. That's coming soon. It's 10 days long and it's uh it's a lot of fun. Right. Uh next, I keep mentioning I have a geeks course in development, which I do. Um, and I'm sort of working on a series of courses that are going from sort of getting started, setting up your first uh, geek system, not just installation, but sort of like what do you need to learn to uh, maintain the system day-to-day and uh, then going from that to, you know, actually crafting your whole system end to end and how to do more advanced development with geeks, etc., etc. So, there's a lot of things that I've got sort of sort of planned, but um I'm working on the first one now. And um what I want to do is get the people involved in systems guild uh to join for kind of working with it through working through it with me as I develop the course material sort of uh kind of like just giving it giving things a try, reading through it, let me know what they think, you know, let me know what I missed uh that sort of thing. So, the people who join the system crafters guild, which is kind of like Patreon, but it's my own thing, um, at the $15 a month tier or higher, uh, will be, uh, added to a group on the forum that where we're discussing the material, which I haven't done in the last couple weeks cuz I've been busy with other stuff, but I'm getting back to that uh, this upcoming week. Um, but anyway, you'll be added to a group where we're going to be discussing the material. And uh we I I'll definitely be looking to people's feedback to kind of uh fine-tune the the course as we develop it and also sort of try it out and and maybe you'll learn from it through that rather than, you know, taking the course yourself. So, I don't know. We'll see. Uh if you want to learn how to join the guild to be a part of this, uh go to systemcrafter.store. If you scroll down to about the middle of the page, there's a join the guild section here. Um, if you join, it's going to ask you, excuse me, it's going to ask you to create an account, which is for a different site than the forum. It's confusing. I kind of want to change that, and I probably will at some point, but for now, it's going to ask you to create an account on this site, the store site, and then you'll also create an account on the forum. So, two different things. Um, just keep that in mind. But, uh, at least if you if you sign up, then I I will personally add you to the group whenever uh you're in on one of those tiers. All right. All right. And also, I should mention this stream is sponsored by the system crafters guild, which is the people who have uh decided to um support the work that I've been doing on the channel. So, thank you to all of you who are members of the guild. There's a number of you here right now. So, I appreciate all of you who uh who who have uh joined. Uh, I am trying to eventually get like an overlay I can show on the screen with the people who are in the in the guild, the current guild members and sort of just like do it um live every time. So, be able to thank people on on here. So, if you want your name to be showing up on the screen for that, uh, also you can join. Mike says, "Me too." Yes, Mike, you too. You are a member of the guild, dude. Uh, GK Sudo says, "On the topic of scheme is mesh end of life." Well, it was never really alive per se. Um what I'll say is the reasoning for uh creating mesh was because I had certain kind types of applications I wanted to develop including things on the web and uh dial hoot has kind of replaced the need for mesh in some ways because it does give us the ability to compile scheme to web assembly and run it in the browser. So, I don't know. I mean, like I enjoy working on mesh, but as I've said multiple times, uh there's something about compiler development that will suck you in and you will forget about everything else that you need to do. So I am trying to avoid it somewhat because I don't really want to uh uh get sucked into the black hole of uh compiler development again because it's a lot of fun and you will get sucked into a black hole and you just continually um like find new ways to spend your time working on compiler optimizations or abstractions or all types of things like that. So anyway, yes, I love mesh. I think it's a fun project, but uh for now it's on hold, that's for sure. I'm focusing my energy on Guile for the most part at this at this point. Okay, so let me see if there's anything else I missed in the chat. Gun says, didn't O mention some O spreadsheet program in their first Penguin book? I don't know. Uh K says that Ledger is written by John Wiggly, too, which is why Emac integration is pretty good. Yeah, we should mention that in a second. Let's see. P the Sailor says, "Don't hate." Alejandra says, "Common list is good but weird." It's probably fine. I don't know. It's probably fine. I'm more of a scheme fan. What can I say? Paul Edward says, "Gele rules the world." I don't know if it rules the world, but it's good. Uh R.J. says, "Will there be a way to try it in a DM? I don't want to break my only laptop trying geeks." Yeah, definitely you could definitely try geeks in a VM. It's uh I mean you can actually download a VM image with with it already installed if you want and just play around with it there. So it's another possibility. Okay, plain text accounting in EMAC. First of all, let me drop some links in here. So I'm going to drop in uh plainextaccounting.org first because that is one thing that uh that case had mentioned. It's a great website uh for explaining this concept of plain text accounting. So if you are an enthusiast of Emacs, I probably don't have to explain to you the value of having uh important information in plain text. So one big example of this is or mode files where not only do you have you know written information in the or mode files but you also have code blocks that can be executed. You have tables that actually can do spreadsheet like behavior. Um you can uh generate documents out of org files. You can do all sorts of stuff just from a plain text file in org mode format. So we already sort of understand that plain text file formats can be quite powerful. Um now there's a whole subgenre let's say of plain text format stuff around accounting. And this plain text accounting website kind of catalogs the different programs and techniques you can use for plain text accounting. Um now why would you want to do something like this? Well I mean probably I don't have to explain it to you but I will explain it to you. Uh the idea is that it would be very convenient if you could write your accounting information your ledger let's say your series of transactions between accounts in your accounting um in your bookkeeping process let's say if you could write those all in text. Why? Well, because text is very easy to process and it's easy to process from multiple tools, especially if the format of the text is uh pretty amenable to, you know, regular expressions or other kinds of text processing patterns. Um, it it could have a lot of value for you. So, it's not locked away in some proprietary format uh in from a proprietary program like a QuickBooks file or something. I don't really know like if those are stored in some format that could be read easily, but they're not really meant for you to go and crack open and start messing with. So, um, having stuff in a format that isn't like an XML file or some other weird stuff like that. Having it in a normal plain text format that is human readable makes it really, uh, useful to a person who knows how to use good tools. Also, it makes it so you can store all of your accounting information in a Git repository, which is pretty awesome. Um, you think about, you know, doing actual operations to your accounting books, let's say, uh, if you're, you know, updating your accounts or maybe you're trying to close your books for the quarter, uh, for a business or anything like that. Being able to check that stuff into a source control repository just gives you way more of a sense of, uh, stability and security that you're not going to lose your accounting info just because some program crashed and decided to eat the file. So um I don't know that plus other reasons are why something like this would be useful. Now obviously a person could say well I mean if it's not in a database that means you have to go reread the text file every time you want to do uh operations on your accounting information. Well sure yes but probably you're not going to have you know hundreds of years of accounting information that have to be processed every time you run it. So you know it's probably not a big deal. I think that there's not really a big concern about that. Um so this this site kind of goes through the thought process. In fact, let me uh make this not blinding. What is accounting and what can it do for me? Accounting is tracking the flow of valuable commodities such as money or time. Hm. Okay, that's very abstract. Um really what accounting is for the purpose of what we're talking about today is tracking um the flow of money. money coming in, money going out, and also uh money that you owe, right? That's kind of the most important thing for a person tracking their personal finances or a business tracking finances. There's, you know, tracking of assets and things as well, like maybe you have holdings of some sort, like financial holdings or real estate or equipment, computers and stuff. You might have to track those things as well. And a a bookkeeping system can do that for you, can help you do that. So, um, a lot of these plain text accounting softwares will be do something called double entry bookkeeping, which is like, um, a more reliable way to track how things move between accounts through something called credits and debits. So, for every piece of or for every amount of something that goes through the system, it has to come from somewhere and it has to go somewhere. So because of that, you have to kind of tweak your brain about how you think about how you might do accounting. It's not really the same way that you would expect. Uh but actually is quite interesting for people who are kind of systems minded or programming minded. Uh I think that you will find if you look into double entry bookkeeping, um you'll probably just want to do it because it feels interesting the way that things are done. I'll try to get into a little bit of that as we go through the examples. I'm no expert on this by any means and I haven't really done a whole lot of it in the last year. I've done it, you know, on and off over time, but um I'm sort of just trying to convey to you that there is something interesting about this. It's not just some boring, oh, let's just talk about accounting on a stream uh you know, for boredom or something. I don't know. Excuse me. No, it's it's interesting. So maybe I can try to convey that to you a little bit through the course of the stream and you will give it a shot and try it out. One second. Sorry, I'm getting over some weird bacterial thing and um it's been a a whole journey. Let's see. Oslo says, "Plain text, but if it's not in some hard to read binary format, how can I take it seriously?" Well, some people do think like that. That's true. Hey Dave. Dave says, "Accounting fun stuff. I don't use any of this stuff, but Spritley uses bean count with Emacs." Yeah. Uh Emacs is a good interface for this stuff as we'll try to see in a little bit. Okay. I'm not going to explain double entry bookkeeping to you, at least not top to bottom because that would be really boring. Uh what is plain text accounting? In 2003, in 2003, John Wiggley, who was, you know, major contributor to Emacs and also at one time the um lead maintainer of Emacs, is that right? Invented Ledger, a command line reporting tool and plain text data format for efficient double entry style accounting. Ledger's ideas appealed to so many to many software developers and technical folk. In 2007 and 2008, it was joined by H Ledger and Bean Count respectively. And it's a 2019 there are more than a dozen ledger likes because if you think about it uh this is a pretty easy type of program quote unquote easy uh to just like write a program for a language that you're learning. So if you want a kind of fun project idea for a lang language that you're learning, you could write a clone of Ledger in your language of choice because what you're really doing is um reading in files, calculating data that's coming from those files, and then printing out reports. I mean, that's pretty straightforward, right? That's a pretty good test project, I think, for learning a new language. So anyway, that's probably why there's so many now is because it's why not why not just write another one? Um, so, uh, many add-on tools and an an active community. The plain textaccount.org site was started in 2016 to help keep track of it all. All right. So, these are command line tools. That's another interesting thing about this. It's not like a graphical program that you start up. It's you write plain text files in the format that Ledger expects. And if you have a tool like Emacs, it can help you to write those files in a more efficient way. uh efficient way and structured way and then you run a command line tool to operate on those files. So you can write your Ledger files by hand and not even have to run Ledger at all until you need to do calculations on the information that's in those files which I think is kind of interesting. Uh let's see. Pi says David is being uh being international. We should review IASB and IFRS. Please don't bring more of these uh international accounting and uh tax things into uh into the picture. Zero says, "Can you simply tell what is double entry system?" Well, that's sort of what I did already. Uh in a double entry system, you have accounts where where money comes from an account and goes to an account through credits and debits. So, it's really just a way of tracking how money flows between accounts. All right. So that's what we'll see for now. Um, let me get a link to Ledger. So Ledger accounting program. All right, there we go. Ledger CLI.org. So we'll put that in the list as well. So um, the alternative to Ledger that many people use, which I've also used a bit, is hledger. Uh, Hled Ledger seems to be mostly compatible with Ledger format. There are slight differences here and there. Um, one reason why people use it a bit more often is because it is said to be faster than uh, Ledger. It also provides more features. I think it has like a built-in web interface. So, if you wanted to um, edit your uh, account information um, in a UI, you could do that using the uh, back end of or the graphical back end of HL Ledger. So, there's there's some advantages to using Ledger. I'm only going to focus on ledger. Sorry, advantages using H ledger. I'm only going to focus on ledger today because it is sort of a standard for this whole model. So, uh that's what we'll start with. There's also a uh ledger mode for Emacs. I don't know if that's documented in the docs for ledger or if it's somewhere else. Alejandra says uh finds accounting boring. Well, it can be boring. Yes, it can be boring to have to do the work on it, but actually as a concept, it's pretty interesting. Double entry bookkeeping. It's interesting. Emacs the Oh, another interesting thing about this which we should get to and don't let me forget is uh you can actually put your ledger information into org mode files and there's support for having ledger blocks in org mode. Um I think that actually is built in. And one of the languages supported by Babel is Ledger. So if you set up your Emacs config correctly, I think it should work, right? Um then what you could do is have your um your ledger entries in a block and then you can run a report on those to get the uh balances for the accounts after uh that point. Okay. Yeah, you do have to set up a ledger in your org babble doload languages uh config. Uh, let's see. So, we'll come back to that. Let me just put that link in the notes anyway. From the manual. Okay. Zoom all the way to the top. So, um, let me get Ledger installed correctly first because I don't actually have it in my geeks config. At the moment I have h ledger but not ledger. So let me find is it an emac here? Ledger. Let's see. Come on. Load hunter says knows that meta up and meta down moves items in the list. Yes, I know. but it doesn't do it reliably for me the way that I expect it to. And I also don't like moving my hand over to the up and down arrows. Um, ledger Emac ledger mode. Okay. Do I not have that in here? Be kind of weird if I didn't. Oh, I think I broke it out into finance. This is the kind of weird stuff I'm doing. I have a home service for finance. Do I have it on this system? I don't think I do. Uh, let's go to systems phantom. All right. And then Whoops. There we go. Now let's go to uh control cg uh us. Hey Dominic says maybe ledger makes accounting less boring. It does. It does make it less boring. Let's let it take a second here and uh try to get that installed. What I want is to have actual Ledger installed. Apparently, I didn't have any of the packages installed so far. So, a new new home. It's a new that's complaining. Okay, looks like it's going to finish fairly fast. Dominic says, "I have a literal coding file to manage my yearly budget for external partners." Uh, you mean you wrote code to do that? Basically, I mean, it may make sense. Hello to Minacy Mecca. Mining Mecca says, "I've used Ledger exclusively for bookkeeping my self-employment, but not really mess around with fancy reports or or blocks." Um, yeah, it's it's pretty awesome. Definitely using it for bookkeeping, for business is uh is pretty good. By the way, I saw your email, Miny Mecca, on your on your newsletter. Uh, I saw that Y2 Roll is going to be released fairly soonish. Do you have news on here? People should sign up to your mailing list. Anyway, Menacing Mecca is a game developer and uh has participated in a few of the game jams. I know it was like maybe a couple of them, right? Recent list game jams. Anyway, sign up to Minacing Mecca's mailing list. I want to see if there's is there an archive here and archives are not enabled. Anyway, I want to tell people that your game is going to come out relatively soon. They should check it out. Why is it Y2? Okay, it's Y2 roll. Anyway, kind of N64 style graphics, kind of like uh, you know, one of those games where you're rolling the ball around and trying to keep it on the on the balance stuff. Anyway, just dropping that in there. Okay, just dropping that in there. Wishlist. Uh, Miny Mecca's game, friend of the channel. All right, so Dominic says, "First ledger and then a bit of Python and GNU plot at the end." Yeah, gnuplot would be pretty cool for that. Look at all this uh Haskell library stuff that H Ledger has to install. I'm not real thrilled about that, but whatever. It'll get done. So, Zera says, "What shell are you using now?" Uh, this is not a shell. This is me running a command. All right, let me show you what this is. Uh, controll HRL Capital Gus S. Yes, that's a terrible binding. This is my DW geeks update system command which really just runs async shell command and runs a script of mine and puts it into a specific buffer. So it's not really a shell. My pleasure. Menacing Mecca. All right. So yes, that's just a command that that runs it in a in a buffer that I set. Geeks system update. There we go. We're compiling things now. What's going on? Yes, white roll does look cool. Uh, one of the reasons why I ever heard of Menacing Mcca to start with is because I saw some of his stuff on Twitter a while back, like some of the shader stuff that makes games look like N64 games, which which I thought was really cool. Alejandra says, "Ledger is not GPL, but BSD licensed if that concerns anyone." Well, I mean, shouldn't really because you still have software freedom. It's just not GPL type freedom. Sho says, "Uh, how about GNU cache?" GNCash is cool actually because you can extend it with Steam if you didn't know that. Um, I haven't really used it too much, but it is nice, you know, if you want a graphical program for doing your accounting. Um, it's nice, but I haven't really used it. I'm much more enchanted with the idea of having a text file for my accounting. So, this is not Ledger that we're having the problem with right now. It's Hled Ledger. Hledger is written in HA hasll. So that's why we're having to install all this extra stuff just for H Ledger. I have both of them. I had Hledger in my profile already or my home service profile already. Um but I added Ledger now. Ledger only is a C application. I think it only had I don't even know if it know if it had any dependencies. Let's see. Ledger, do you have dependencies other than compiler? Okay, it has a few, but still. They didn't do all the extra hasll stuff. Come on. Let's go. Come on. All Well, Nunes says, "I use GNU cache with Postgress database. I like to have, excuse me, I like to have an underlying database so I can join data with more external sources and create my own graphics." I mean, you could do your own reports and uh stuff like that with Ledger. Gun says Gledger would be written in Gile and uh K says Sledger. Mhm. I'm just waiting for Case to write one of these programs in Bash. Uh because that's what Case likes to do. He likes to just go and write up the you know things that exist already in Bash. Uh I'm not saying it's a bad thing. I'm very impressed with his patience to do that. But uh yes, I'm waiting to see uh Bashledger. He says, "No, I'm done with uh with Bash Bledger." Yeah, that sounds good. You're being bludgeoned with Bledger. Not the person using Bledger, but the person who's writing Bledger is being bludgeoned. Uh there's no SC copy today. I guess Ashra is probably is uh busy with uh things that are more important than copying messages across. The bot is that reliable? No, that bot is more reliable than me. The bot is a person. All right, we're waiting for my entire system profile to uh be updated. Friendship over with bash. Now common list is my best friend. They were referring to the classic meme Sounds like the sort of thing Bad Cop would make on stream. Never heard of Bad Cop before says, "I plan to rewrite my tax program in Common Lisp." Yeah, get some some clo in your uh your taxes. Some Clos for your IRS. Are we done yet? No. Sorry, folks. All right. I should probably be looking at the manual for Ledger while we wait on this. Okay, so fat-free accounting introduction to Ledger. Ledger is an accounting tool with the Moxy to exist. How about that? It provides no bells or whistles and returns the user to the days before user interfaces were even twinkling in their father's CRT. What it does offer is a double entry accounting journal with all the flexibility and muscle of its modern-day cousins without any of the fat. Think of it as the brand muffin of accounting tools. app. Um, I don't think anyone is going to be excited by saying it's the brand muffin of accounting tools because it just sounds like uh something you don't want, right? You should say this is like the the delicious glazed donut without sprinkles of accounting tools. Then that would probably sound better. But, uh, I don't want to go too far into my critique of the marketing. Okay, Big says, "So, basically Ledger when spreadsheets are too user friendly." Yes, this is what we do a lot in this channel. We take things that are already user friendly and we make them less friendly because it's more fun that way, right? An amazing Bash streamer. She'll make Bash do things that'll blow your mind. I don't know. I I feel like that would be uh more stressful than anything. To use it, you need to start keeping a journal. The basis of all accounting. If you haven't started yet, now is the time to learn. Uh checkbook journal records debits. Wait, hold on. Okay, so there. Yes, a checkbook journal is is a journal. So okay the the core concept here in Ledger is the journal which is basically the um series of transactions that are happening between accounts um that you're logging and then the program is able to go read that journal and then uh do a lot of calculations and generate reports from that. So, uh, because you spent the time to write down all of your transactions, the money amounts, where they go, that sort of thing, um, this program can go and calculate all that up for you, and then let you know what the, uh, the result is, which is cool. What computers add is the ability to walk through these postings and tell you things about your spending habits, let you devise budgets and get control of your spending, squirrel away money into virtual savings accounts. That's another thing that's really cool about double entry bookkeeping. Um, if you want to save money for various different purposes in your personal life or even for business, um, double entry bookkeeping basically gives you the ability to create infinite uh, special purpose accounts for moving money around. And it's this money doesn't get moved around in reality to different bank accounts. It's being moved into like little buckets that you create for certain purposes. and um you're sort of just tracking how much you have for a given purpose and it it lets you to do that pretty easily. So, it's it's a nice model in my opinion. Dominic says, "Send you the skeleton of my literal ledger file via email." Cool. Gun says, "Can you also hook it up to your banking software?" I'm not 100% certain about that, but um I would guess there must be some way to uh interoperate Okay. So, um, let's get to it. All right. There's been a lot of talking here. Here's an example of a couple of transactions in a journal. And this is what the actual plain text format looks like. So, here's a transaction at Trader Joe's, which is a grocery store in the United States if you haven't heard about it before. Um, it's $100 that is uh being credited to the expenses/g groceries account which is basically a categorization for the expenses that a person is um paying for uh related to groceries. $100 and that's coming out of the assets checking account. So you have assets which is uh the the things you have that have value and you have expenses where the money needs to go. So you're basically moving $100 from your checking account which is you know the money that you have for this purpose to your expenses groceries accounts. That sort of shows you how your money is flowing from your checking account to a specific type of expense. And that's one way you can use it to check your um how you're spending your money against your budget etc. Then there's a Whole Foods transaction, which sounds weird to me because Whole Foods is generally more expensive than Trader Joe's, I think. So, why is it 75? I don't know. Uh, another one where you're paying $75 over to groceries from your checking account. In both cases, the money goes to the groceries account even though the payes were different. You can set up your accounts in any way that you choose, which is cool. Enter the beauty of computerized accounting. The purpose of the ledger program is to make general journal accounting simple by keeping track of the balances for you. So, uh, one thing that you don't see here is that you're not explicitly explicitly saying that you're taking you're debiting $100 from the checking account and putting it into the groceries account. Um, there's an implication here that the $100 comes from assets checking. So, the program can figure that out for you. You're not having to write it all out literally yourself. So, that's one of the things that's being implied here. All right. So then uh when you want to u look at the actual balances for things, you can have them in a file and then run through the ledger program ledger-f with whatever file that you've stored the information in. Uh and you're also um calculating the balances of the accounts in that file. So, this balance I think is a command and it is just writes out in plain text format the uh balances for the account after this transaction. So, you've taken $23 out of your checking account. You've put 23 into the u expenses account, right? So, this is sort of the core of everything. Now, it looks pretty boring, I think, from the outset, but uh hopefully we can kind of get a little a little bit further in depth here. I may have to leverage AI unfortunately to generate some transactions or if I could just find like an example ledger file that would be just that would be equally as good. Um I just need I want to have a file that actually has a lot of stuff in it so that we can actually see what it looks what it might look like in practice. So let's see example ledger file. Um, that's a really generic search term. Plain text. I want a really like real world example [Music] file. Ah, Jack Batty. H how many different sites does Jack Batty have blog posts on? I can't really say much because I also have a a problem with that. But Mike says, "How about excuse me, how about deficit spending? I must be able to spend more money than I bring in." Yeah, you could definitely model that with this uh with these tools. That's for sure. Real world example. Yeah, I don't really see any good examples of this. All right, maybe we'll do that in a little bit. But we can try to just like make up some stuff to start with. So, uh, here's what I'm going to do. I'm going to create a ledger file, uh, let's see, accounting.lgr. I think LGR is kind of a file format, um, extension that people usually use for ledger files. How do you start your accounting assets? Checking savings. Yeah, let's talk about um, setting up a chart of accounts because that's kind of interesting. a chart of uh accounting with ledger principles accounting. Uh that's definitely a good section to read. Accounts and inventories ledger chart of accounts. There's a way to set this up. Ozo says, "You need to get sidetracked into generating fake but realistic ledger files." I'll let AI do that for me because it's good at doing things like that. I want this for the program ledger. Plain text. I don't know, dude. Anybody got an example here? Uh let's see. Let's see. Okay. So, let me let me go ahead and say this. You don't need to create a a chart of accounts to start with. And what is a chart of accounts? A chart of accounts is effectively just a list of accounts that you have for your entire bookkeeping workflow. So, as you saw, there was like the checking uh uh sorry, expenses, uh groceries, things like that. that there's like a nested hierarchy of um categories effectively. The accounts are kind of categories in a way that you have expenses, you have assets, you have liabilities usually, and you could probably have other things too. It really doesn't matter. You can set up however you want, but um you effectively have to if you want to have an organized bookkeeping system, it's good to sort of think a little bit in advance about where things are going to come and go from, which is one thing that's nice actually is that um you can always change this stuff. you can use find and replace, you know, or grep or said and o or whatever to to like really process the crap out of all your text files and and change it to whatever you want. So, um it's very malleable. That's another benefit of it all being plain text. You check it into a source control, then you can just make whatever edits you want across all the files. You can rename all your accounts. You can restructure them to whatever you want and then everything will be fine. So, it is um uh that is another benefit I think. Let me see. Accounts. Working with multiple funds and accounts. Structuring your accounts. Great. Okay. Yeah. Can you tell me how to do that? I think there is a way to do this. This thing even gets into like uh stock prices. Ah, separate account. Here we go. S separate file. You have to edit this and add the account directive in front of every line. That's fine. Okay. Yeah. Yeah. Yeah. You can generate the file. Got it. Okay. So, account expenses, account expenses, groceries, account assets, uh, checking, account assets, savings. Now, um, ledger mode. I don't think I have it pulled in. Oh, right. Uh, geeks autoload packages. Ledger mode. There we go. Now, this is ledger mode. So, one thing about ledger mode in Emacs. This is supposed to be about about Emacs, right? You turn on turn on ledger mode, it actually turns your uh ledger buffers. It it syntax highlights them. It knows the syntax of ledger files. It syntax highlights them. It also provides um completions for certain things like your account names and other places that you have um paid from or sorry other places that you have done transactions from. So it is kind of useful for that. So, let's see. Expenses, utilities. That's another good one. Account ex. I'm going to type ex and use control. Let's see. Ledger. Okay. Is for transaction expenses. I thought accounts work too. Uh, what else? Then we could just start with that. accounts liabilities credit card. Okay, you can say that too. So, um let's try to create some things. I think there's a way to create uh transactions. Crl Hm. I'm going to look up the ledger mode key bindings. Oh, CMI does completion of point. Uh, all right. Crl+ A. Ledger ad transaction. So, Crl+ A. It's going to ask me the date of the transaction. I'll just say today. Uh, transaction. What would I say? Um, kiosk. I don't know. Wait, what? No accounts or past transactions matching kiosk. Let me see. Ledger add transaction. Use ledger uh to add a transaction to buffer if inserted point blah blah blah blah blah transaction text. Maybe I actually have to type the entire text. So what would that be then? I think there's also a way to do to do it from the command line. So, we might be able to find the format of that entry. Yeah. It's weird that it doesn't let me do it, though. No accounts nor past transactions. Well, I need to have a transaction, don't I? All right. How about this? Um, what's the date format that it wants? Year, first, month, day. Okay, so 2025 slash uh 0411. I'm just going to say kiosk because I I go uh buy monsters from kiosks. Uh Monster drinks. Let's see. Um kiosk. I press enter and it goes down the next line for me. So, uh, expenses colon. I'm using um Ctrl Alt I to get completions. So, it's giving me completions on it's giving me completions on my account names and it gets them from the current file. So, it kind of knows what the um what what the things are. So, uh 2 euro I don't have the euro key though. So, I'm just going to say they're $2. All right. And then where's that coming from? It's coming from assets uh checking. Okay. So, that's done. That's that's here. Now, the thing about um this this being read is it they they track whether the now kiosk is a a different thing. It's a is sort of the place where a transaction comes from. It's not the same as a as an account. It's more like a a label for transaction. Is that the right way to say that? Anyway, um it gives you the ability to uh reconcile transactions. So, this transaction, if we haven't actually seen it go through completely on our on our uh credit card or debit card or something or bank account yet, we can leave it without the star, but later whenever you've gone through your bank and you see that the transactions have actually gone through, you can put a little star here and then it take makes it not red anymore. So, that's what this uh thing means. There's probably a command for that, too. So, crl hm um reconcilet cr Oh, that's not right. What is it? Is it crrol e? That's it. Control c control e. You're toggling the state of it. Basically, toggle current transaction. Anywh who so now that we have this uh ledger display balance. So, crl + p display balance a point. So, our monster balance as uh $2. How about our checking? Wait. Posting with null amounts. Account may be misspelled. How's that? So, let's try the reports. Crl H. Crl + M report X8 red Euro. Yes, thank you. Let's see. Play ledger stats. Um, okay. I've got an error in here somewhere. Posting with null amounts account maybe misspelled. Oh, did I screw that up? I think I need to tab that out or something. So, what was that command? There's a command that I saw for um align the transaction. Control tab. Is that right? That's right, menacing mechan. You need a bunch of white space. I'm trying to get it to do that for me, but for whatever reason, it doesn't want to at the moment, which I think is a little bit strange. Oh, there we go. So, okay. So, I had to add a little bit of space for it to kind of wake up and realize it. An extra space. And then hitting tab did it. All right. So, here we go. Control P. Okay. So, checking is -2 is what it tells me. All right. Thank you, Mark. Mark says two spaces. That's right. Um, all right. So, that's one. When the infinite print money print infinite money command, I don't know. It'd be nice if there was one. All right. So, let me see. Dealing with petty cash. Oh, you can have a cash account. Yeah, that makes sense. Balance. Balance. No. Ledger balance string P nil. How's that work? wrong. Sorry, I'm trying to get my uh fingers working here. So, port control crlr balance. Okay, there we go. So, I ran a report using c control or controlr and I selected the balance report and that gave me the list of balances currently for the transactions that have happened in this ledger. Okay. So, we see that there's negative $2 in the checking account. There's also um the other account where the monster uh expenses go to which we can see uh quit to redo. So, there it gives us a little bit of a popup there it seems for the commands which is cool. Let me run that again. Okay. So, E to edit, S to save. I don't know what editing would do. or command line. Okay. All right. So, we need some more transactions. Uh what about getting paid from somewhere? How does that work? I can't remember. Uh revenue, I think. Income. Job. Sure. So, how about I get paid for my job? 04 uh 11. The job, whatever that job is, it's going to go into assets checking, let's say 500. Sure, why not? And then it comes from income job. So, this is sort of the idea with the whole double entry bookkeeping thing. Money has to come from somewhere. It doesn't come from from trees, doesn't come from space, comes from uh an account. So you have to create an account of some sort to uh represent where that money is coming from. In this case, we're create creating an account uh that's being debited called income job and that money is being put into assets checking. It sort of it just gives you a way to show the flow of money from certain places. Uh then you can generate reports on that later to see like how much money you got from a certain source. Let's say if I'm wrong about this in uh let me know in the chat but that's uh sort of my understanding of how this is all working. So if I do a report at this point get the balances uh I can see that my checking account has $498 left in it after I spent $2 on monster because I made uh $500 from my job. Okay. So, you can kind of see how like over time as you add more and more uh entries into this ledger, you would see um more value from it because you would be able to break down all of your income and expenses and also what money you have in various different accounts um to do that. So, another thing I can do is have like an account for savings, savings, new computer. So, that's like a virtual account. If I wanted to, I can move 250 bucks over to that. So 20 2025 0411 um new computer savings let's say we're going to move that into the savings uh new computer and we're going to put uh 250 gun says do you put everything into one ledger file um I would say for a given time period you probably would um there's probably ways to do includes include the state stated file as if it were part of the current file. So, I mean, one thing we could do here is we could say uh accounts LGR. We could drop all these in there and then include accounts.l accounts.lgr. Right. Drop that in. And then uh do the same thing. I This should work. I think crl or. Save the buffer balances. Oh, right. I never finished that. So, um, assets checking and then cr balance. Yes. So, you get the same thing basically. Um, but I wonder does it work for things like completions? So, if I were to to go back and pick that out, assets checking. Okay. Okay. So, it doesn't give me the option for savings. So, one downside, one potential downside of not having your accounts in the same file. Could be that um the mode can't figure that out. Uh menacing mega says, "I normally split split up my files per tax year with no includes to keep things separate." I think that's actually the approach I would take, too. Um there's this concept of closing the books which means that excuse me after a certain period of time whether it's quarterly or yearly or however you want to do it. Uh you generate a um report of all your accounts at the end of that time period and that's sort of like the state of your all of your accounts. Then then when you start up your your new time period like a year or something, you import the the balances of those accounts to set the sort of context for that time period and then you continue forward with what you're doing. So for that current year, you don't need all the transaction data for the previous years necessarily uh because you can just run reports on the previous year file. You can just deal with the current year file to only have to deal with the things for the current year. G says the job David confirm as a hitman nicknamed the fisherman. Yeah, I don't think so. All right. So, uh we will undo what I had done putting the accounts in a separate file because hey, I want to have completions working just fine inside this file. So, let's do that. And this comes from uh assets uh checking Excuse me. So, now we're back to the uh the balance we had before. So, at this point, excuse me, our checking account has $248 in it. Um well, we are going going to assume our checking account has $248 in it. But in reality, that money that we move to the savings new computer virtual account is not actually moved out of the real checking account. We're doing this only for our own tracking of money. Um the the reality of our actual checking account will probably match up to um we we there's probably a way to generate a report so that you know what the actual balance should be of the checking account without the virtual accounts. I'm not sure exactly how that works, but um but you would be able to match it up at least and say that the um account should have the amount that actually does like in reality like your your checking account should have the same in the end. Um anyway, so that's that for now. So, what else do I want to show like as far as uh Emacs and Ledger together? I'm not trying to do like a comprehensive Ledger tutorial here by any means. I'm really just sort of trying to show that you can do this stuff and it actually works out pretty well. Uh let me just toggle these. I just don't I don't like looking at them being uh not completed. Uh those of you who have done accounting before in the chat, is there any any other cool stuff that I should try to do to show things off a little bit? I'll also take another look at the um the manual, see if there's anything interesting. So, let's go back up. I want to go to the uh principles of accounting with ledger stating where money goes. Accountants will talk of credits and debits, but the meaning is often different from the layman's understanding. Uh to avoid confusion, ledger only uses subtractions and additions. Uh Alejandra says, "What does the toggle state of the transaction mean?" The toggle state means whether you've gone to your bank account and seen that that transaction has completed or you know that that it has been completed. It's just a way for you to track whether um reality matches what is there for that transaction in your ledger. At least that's my understanding. It's like just just a way for you to track that the the transaction is is uh is complete. All right. Recall that every posting will involve two or more accounts. Money is transferred from one or more accounts to one or more other accounts. Yes, you can do multiple accounts as well, which is kind of interesting. Uh for one transaction to record the posting, an amounts amount is subtracted from the source accounts and added to the target accounts. Yes, pending transaction versus confirmed. Thank you, menacing Mecca. Uh, in order to write a ledger transaction correctly, you must determine where the money comes from and where it goes to. For example, when you are paid a salary, you must add money to your bank account and also subtract it from an income account. So, that's basically what I did here. Income job. I could call it salary. How about that? Let's just do this. I'm going to use normal find and replace Emacs colon job uh colon salary. Boom. Now, it's done. That account has been renamed. that will be reflected in the reports because this is all coming directly from uh the text file, right? Uh menacing Mecca says, "So like when the invoice is made, it's pending and when the money has gone through is complete." Yeah, that's a good point, especially if you're waiting for people to pay you. Uh no, there's another way to do that too with double entry bookkeeping, which is having I guess your your invoice could be a liability at some point because it's it's money that you expect, but it's not cleared yet. I might be wrong about that. All right. So, let's see. Uh, what else can we do? When you earn money, the money has to come from somewhere. Let's call that somewhere society. In order for society to give you income, you must take money from society in order to put it into or make a payment to your bank. When you spend that money, it leaves your bank account and goes back to society. This is why income will appear negative. reflects the money you have drawn from society. So yes, this is how much you have stolen from society. I have stolen $500 from society by having a negative $500 balance in my income salary account, just so you know. So that should give you some motivation to go make more income because you get that to have that negative value for your income whatever account get bigger and bigger for all the the uh value you have extracted from society. Yes, you strip mind society for value. All right, let's see what else. Uh, this is the beginning of economy after which the explanation gets terribly difficult. Yes, of course. No comment. Uh, based on explanation, here's another way to look at your balance report. Every negative figure means that that account or person or place has less money now than when you started. Cool. Assets and liabilities. Assets are money that you have. Liabilities are money that you owe. Liabilities is just a more inclusive name for debts. An asset is typically increased by transferring money from an income account such as such as when you got paid. Liability strike money owed to others. This can happen when you borrow money to buy something or if you owe someone money. There's an example of increasing a Mastercard liability by spending money with it. Yes, you're basically saying, I'm taking money from account that has to be replenished at some point. I have to pay that back. So, that's actually kind of an interesting example. Um, should probably do these on different dates, but whatever. 0415. We're going to go into the future now. Future. Um, let's see. Dinner at McDonald's. So, um, liabilities. What did this say there? Liabilities. Credit card. I'm going to spend, uh, $82 at McDonald's. Why? Just for the sake of example. Yes, for the sake of of example. Uh oh, that actually comes from the credit card and it goes to expenses food or we can be more specific. Expenses fast food. Let's get a breakdown. Expenses fast food. And that was what? $82. All right, cool. So now if we run our uh balances, we see that we have negative82 liability on the credit card because we have spent money from the credit card. So we now know we owe $82 back on the credit card. So we can actually make a payment back on the credit card later in the month. 04 uh 20 uh pay credit card. Now, um, liabilities, credit card, we're going to pay $82 back. Why not? And that's going to come from assets, uh, checking. Okay. So, now if I run the balance again, we see that, uh, the credit card doesn't show up anymore because we've paid it. That balance is zero. Um, but we see that the assets checking account keeps going down from the things that we are spending from that, right? So since certain balances are zero, it doesn't show those those accounts, which is nice because we don't get uh inundated with information that's not relevant uh for the case that we for the current state of our finances, let's say. So um that's cool. That's great. That of course sort of shows how we can kind of manage things over time. The combined total of your assets and liabilities is your net worth. see your current net worth using this command. Ledger, balance, assets, liabilities. Uh, let's see. Can I do that with the ledger command? Let's see. Control C balance. Press E to edit. So, when you press E to edit, it lets you edit the command line that's used to generate this report. So, I'm going to say uh assets and uh liabilities. And now it says that I have 166 $166 in assets. I have zero in liabilities because I paid that account off. This seems like regular expressions to me, doesn't it? Like the carrot for assets shows you it's like you're you're you're filtering accounts based on a regular expression, right? Ben says, "Are we syncing transactions?" No, but um it's possible to do that. I think there are tools for doing that. But I haven't used them though. Uh let's see what else. Expenses auto. Another common question asks of your expenses is how much do I spend each month on X? Okay, so I could do that. uh register. Let's try a different a different report. Register report. Oh, that's cool. That's a nice looking report. And that's telling us um the different transactions we have and which accounts are coming from. Another way to look at that. So, um I could check for let's let's do another transaction to buy another monster at the kiosk. I'm basically buying them every day, so why not? Um, all right. So, the kiosk, how to deal with credit interest. Um, whenever you get charged interest, you would have to to log that yourself basically. Um, as not sure if it's an expense. You would probably need to ask someone who knows that better than me, but definitely you want to track that. Yeah, it's you would want to track it as part of the balance of your credit card. So when you when any charge goes against your credit card, even if it's the interest charge that goes against your account, we would want to track that. So I think that's that's how you would do that. This is just plain Ledger Vinwa. We're just going from from plain old ledgers to start with. Gun says, "What about when on vacation abroad? Does it convert currencies?" Yes, it does that. It does that. Her says, "Accrrol versus cash basis." Um, acrruel based accounting is very interesting. Um, but it's more complicated. So, cash basis is what a lot of people use. Is there no way to calculate that automatically like set say to set the interest per month? Maybe maybe Okay. Yeah. So, let me just try this uh register thing real quick. Uh dashm register expenses auto. So, um I'm trying to finish off this one thing. All right. So, I got that. Uh, expenses, then assets. Actually, we're going to we'll use a credit card for this one because I'm terrible with my finances. Okay. Uh now we're going to run a report a reg register report. Okay. And now we can edit the command and say uh what account we want to uh focus on. So expenses monster and we get our log just for that. Is that what what we're trying to look for here? Yeah. All right. So you can just see sort of what you're spending for uh a given category. It helps you to filter that down basically. Aquin says, "Are there integrations against banks so you can automatically fetch transactions?" Uh, there there must be other programs for that. Um, the point here is that this is just plain text information. So, however you can get information into it, you can do it. And there there's probably programs that will do this for you. I just haven't looked into them myself. All right. Tracking reimburseable expenses. Okay. Okay. You can have your own uh reimbursements account that you have to pay back from, I guess. All right. What else? Apply account means all accounts mentioned in the file are children's children of that account. Interesting. Yeah, like what Miny Mecca says, it's bank dependent whether there's tools available. That's right. All right. Commodities and currencies. I mean, if you have stocks and stuff, then that could be useful. I'm not really that interested in that right now. Uh accounts and inventories, you you can actually uh store inventory. So if you uh run a tavern and you want to count how many apples and steaks you have uh I guess in EverQuest, whatever. Uh you can do that. You can you can store any quantity of anything. You create the quantity or the um denomination. You can just invent denominations of whatever and track those because why not? It's just numbers, right? Most confusing transaction in any ledger would be your equity account because starting balances can't come out of nowhere. When you first start your ledger, you likely already have money in some of your accounts. Let's say there's 100 in your checking account. And then add a transaction to your ledger to reflect that amount. Where will money come from? The answer is your equity. So, you have an opening balance. This is also a thing that you end up with from uh closing the books and and bringing them over to the new time periods. You have to have a sort of an opening balance for your books at the time where you start. So, we'll just say 0401. And that's uh opening balances. I'll say uh assets checking 750. I don't know. Assets savings 1,00 equity opening balances. Does that work? All right. But what is equity? You may have heard of equity when people talked about house mortgages. Basically, equity is like the value of something. If you own a car worth 5,000, you have 5,000 in equity. When you start a ledger, you probably already have a net worth. Your net worth is your current equity by transferring the money in the ledger from your equity to your bank account. So, you're crediting the ledger account based on your prior equity. you look at the balance report, you'll see a large negative number for equity that never changes because that is what you were worth before the money started moving around. If the total positive value of your assets is greater than the absolute value of your starting equity, it means you are making money. Uh until you figure it out, put not equity at the end of your balance command to remove the confusing figure from the total. Okay. So, if I you do balance and edit it and say not equity, it removes that out of there. Okay. So, you don't have to see the equity thing in there. So, uh that's cool. Let me see. Ledger balance. I think there's a way to configure the default reports. So, uh ledger reports. So uh you can customize any of these. You can also add other ones you're of your own making. U basically to say that you run ledger whatever the binary for ledger is in the current ledger file and then you put the parameters in for uh what you want to do. So you can have uh reports of any any kind or commands of any kind that you want on um on the report list. Uh let's also check out control c. We're going to look at accounts and then it's actually going to uh give us a completion list for the accounts. I can take a look at expenses monster and then that gives me the register. So I actually don't have to do anything special on that. It just tells me um the the transactions that happen against that account. So opening balances were 750. Monster from kiosk minus $2. We're now at 748. I got paid by my job, added 500 bucks. Uh, new computer savings. I moved money into savings and now we're back down to 998, etc., etc. So, you kind of get to see the listing of things that happen over time with the account, which is pretty nice. All right. Um, cool. So what I want to do at this point is show how this can be integrated with org mode. Okay? Because this is about Emacs primarily. I mean we're showing sort of what you can do with the Ledger program. But um or mode is another big part of the Emacs experience and it is possible to use Ledger with org mode. So let's take a look at that uh to see what what other kinds of interesting things we can do. So uh let's take a look at the manual the org mode section of the manual. So uh or mode has a subsystem known as Babel which allows for literate programming allows you to mix text and code. One of the languages supported by Babel is ledgers. So that you can have ledger commands embedded in the text file and have the output of ledger commands also appear in the text file. Let me go over to the show notes for today. We'll hack together a little bit of a configuration for this. Uh yeah, I'll do that. Now, uh use package ledger. I'm just going to put that there for my own purposes. Config. Um, one of the things I need to do which I had seen is to add this to orb babel do load languages. So we need to add ledger to the list of languages that get loaded up. Um, I may have this somewhere else in my configuration, but I'm not that worried about it. I think that uh it's going to be fine. All right, so that's one thing that will give us the ability to do this. In fact, I could probably just put the stuff inside this org file, which would be kind of cool. Okay, so once the ledger support in Babel has been enabled, we can proceed to include ledger entries within an org file. There are three ways that these can be included. Place all ledger entries within one single source block and execute this block with different arguments to generate the appropriate reports. or place ledger entries in more than one source block and use no web to combine these into one block elsewhere in the file for processing by ledger. Uh which is more than likely what you would end up doing because what I imagine you would probably do in an org file that had ledger entries is that you would have notes about transactions um and maybe things broken into different sections like maybe per month uh things of that nature. So you could have an org file that has all of your accounting for the year and then uh your general accounting workflow potentially and then you have like things broken down by a month for that year and then you can have blocks that have all the uh the entries for that those periods of time. Let's see uh embedded ledger example with single source block. Oh and three is place ledger entries in different source blocks and use tangle to generate a ledger file which you can subse subsequently process with ledger. So you can tangle those out as well if you want to. Uh or notes with accounting entries maybe. Yeah, maybe. All right. Um you could do that. It might get a little bit messy. Okay. So um embedded ledger example in single source block. So we have begin source ledger. Let me close this out. and we'll say uh April 2025. April uh I should probably make a thing for this, but whatever. Begin. So, let's also do this. How about this? Orc bindings are going to kill me. There we go. No pounce. We're going to want the no web style of doing things, too. I'm just going to try to drop some stuff in here just for funsies. Okay. So, let me go over to the accounting file that we have. I'm going to copy the accounts list that we had made. Right. So, we got that here. And then inside of uh April, I'll go ahead and count uh copy our transactions. Uh opening balances, I might move that to the beginning of the year. So, we got that. Uh, I'll just say oops, that's 2024. Uh, 0101. That's fine. break that down to next line and then that here. Um I think we also need to set Ledger file stuff up to be uh colorized. Huh? Why is it not being colorized? It doesn't like the uh indentation. H How can I fix that then? Because it's this is an org mode setting that I have set up and it's uh it's tricking Ledger. We'll see if this works. It might actually give me trouble. Um, I think I could set this per file. So, what was that setting? Um, or babble or block. Yeah, I'm using that Dominic. The problem is more of um I'm concerned NOEB is going to have problems with this. We'll see. Maybe it won't. All right. So, I've got the opening balances set up. I've got the the ledger block set up for April, right? I've got the uh initial accounts set up. So, what I want to do is try to do the the whole no web model on this. This is all in one. And I want to do no web. Multiple blocks with no web. We got to put no web. Yes. On all these to make sure that they work. So organ dent. Um that not that may not be exactly the one 100, but thank you. Uh so we got Oh, not that one. We want that block. We want this block to be no web. And we want uh this block to be no web. Okay. And then how do we run the reports? Generate a register of all the transactions entries. No web. Yes. Overall balance summary. Okay. Oh, do you have to do it that way? name expense. So these are named blocks. Got it. So name is uh April, name is balances, name is uh accounts. Then we can have like a reports section. This is the right level. Yeah. Move it a little bit here. Okay. So, we'll do the same thing. We'll have uh begin source uh ledger no web. Yes, that correct. then command line bow and we need to do the little uh imports here. So accounts. Okay, so that's the three things we've put in so [Music] far. And I think if I press control cr in this block, uh, no execute function for ledger. That's interesting. Let me scroll back up real quick. We got April, we got balances, we got accounts. That should be correct. So let's see reports. See, Ashraz, no worries, man. Have fun. Uh, let's see. Overall balance summary generating a monthly register. So, something's missing in the configuration. Okay, so this Oh, interesting. That has not been updated. Or babel do load languages. Let me go check that code block and make sure that um actually did get executed. Cannot open file OB Ledger. Why not? You know, I wonder if it's in the uh or contrib or contrib. I don't think I put or contrib. Let me go to my geeks config. Max or. Yeah, I don't have or triv here. I'll bet that's where it is. And now we're going to have to wait for Emacs to install this. Let me see. KG us. Let's see what it does. How long it might take because we will have to have this loaded up. Um, Emacs Ledger or Trib. Just make sure that I'm right about this. I think that's right. Let's see what's in here. OB H Ledger. OB Ledger. Okay, so there's a separate one for H Ledger. That's cool. So yeah, or contrib. Let's see how long this takes. But once we get or contrib, then we should be able to load that. Um But wow, did I put the wrong date entirely on this file? That's fantastic. There we go. Real nice. Hopefully this will finish soon. Uh chewing on it on its profile. Um so yeah, once we have this in place, I mean what what are we really gaining by doing this? Um I think there's, you know, some nice organization that uh you can achieve by doing this. You can also use some of the org modes features for um including things. Now the question is inside of a block do we get any uh useful completions or is this something that Emac is doing on a per buffer basis? So liabilities credit card. Uh do we have anything that I didn't use? Any accounts I didn't use? Savings. New computer. Assets. Savings. Assets. Checking. Checking. Checking. Okay. What about savings? Yeah. So, it doesn't actually know about accounts that aren't somewhere else. So, I think when I had tried this in the past, I realized there was a problem with breaking things up into or blocks like this or breaking it into multiple files because the completion functionality in Emacs is actually quite useful for quickly adding new transactions. You can do completions on the names of transactions and you can do completions on the names of accounts and it only sees what's in the current buffer. It knows the format of those transactions and it's able to build a table of completions from what it sees in the buffer but it can't follow paths to includes from other places or it doesn't know how to rationalize org files. So, um I think what I eventually came to was the realization that it's better just to have a normal ledger file and uh just work with that directly rather than try to put it into org files. But it is there as an option if you want it. Just letting you know. All right. Let's see. Yeah, if you have it all in one block, it's fine. If you have it in multiple blocks, then it doesn't really work the same because um it only sees what's in the current buffer for the completions. Come on. 160 packages shouldn't take that long, right? you know uh this is the uh the price you pay for perfection in computing and I'm I'm calling this you know geeks perfection in its own way. What kind of insight can you get from ledger where you can get insight into where you're spending your money uh or where your money is coming from or uh you know just generally do your taxes. I would prefer not to have to do taxes at all because taxes are literally like a four or five month issue for me every year uh for various reasons. And people could say, "Well, it shouldn't be that complicated." Well, you don't really know much about uh the kind of taxes that I have to do. It's annoying. Uh yes, I don't like taxes. Sorry, I keep I keep bringing taxes up as a joke just because it's a pain in my ass uh every year. Okay, so we've got the uh thing loaded up here. Let me reload my autoloads. And I need to go back into the config block so that I can add the ledger language. Now it worked. Find library OB ledger. There you go. It's in here now. Great. So we should be able to go do this. No web. If I use control c uh evaluate this block. Yes. Then it gives us a results block here that gives us the output of uh running that um the the outcome or sorry the output of this does not look quite as nice as what you get running the commands in the command line or running it uh with the ledger mode package in a normal ledger file because it's not being highlighted the same way. I mean, it's just plain text here, but it is plain text that is in the document, which is cool because you can kind of hold that output um and have it all together there as a report that you can look at later. Now, there's two ways you can deal with this. One is well, there's a few ways you can deal with this. For the purpose of accounting, especially for like a business, it would be useful to have some sort of just general structure for uh the information you're you're storing every year. Like you have your actual ledger file, but then you have the output of running the reports you need that need to be stored. You don't want to just run those on demand. It would be nice to have them just sort of in the file checked into repository so you can go look at them without having to run Ledger again for that year. So it is kind of nice to have the stuff in an org file so that you can have the output of the reports checked in. Oh yeah, I have to file US taxes multiple times basically and Greek taxes and they all are uh dependent on each other. So they have to be done in a certain order. Yes, it's fantastic. So I'm filing taxes three times per year at three different times which is great. Um, so I think there's value to some degree of having things in an org file, but it's it it makes it not as nice of an experience in my opinion. I think having just a normal ledger file that you edit much better because you have nicer highlighting and you have the ability to generate um reports in a way that is very readable in my opinion because you see the negative and positive numbers, you can see the names of the accounts, etc. Um, I just feel like this is a better experience overall. And the other thing I didn't really mention is that the editing experience of this is great because it's all your same Emacs key binding. So, all the same stuff that you're used to works. Ctrl L for scrolling around, you know, control NRL P. Um, I wonder if I can Yeah, you can sort of do gradual uh reason selection. I mean, there's all kinds of stuff you can do with the normal uh EMAC key bindings to edit the buffers. So, it's just better, I think, um, to be able to edit it directly in a buffer because you get all the benefits of Emacs for, uh, editing these files. Eker says, "It's not cool if I can't or." Well, it is cool though. And what I was trying to get to before is that I think you could probably import this file into the org file. I think there's a way to transclude a block. You're basically pulling the contents of a block back into sorry context of a file back back into a block and then you can use that as a node web block to then or a general block to execute commands and get the output in the org file. So you could probably have the best of both worlds but uh at least for me I think this is this is fine. Gradual region selection I'm using uh control alt space. It just sort of goes and selects more stuff. What is that? uh control alt space mark s expression but I mean it's it's usable in other files as well it seems let's go into this org file um control s yeah yeah control alt space just sort of grabs more and more stuff all right um let me just double check the manual see if there's anything else that would be interesting just to talk about briefly I'm just going to go up to table of contents and take a Uh, let's see. Commenting in your journal. I mean, you can leave comments. That makes sense. Journal format. Transactions to comments. Command directives. Converting from other formats. Archiving previous years. That's kind of interesting. What's other formats? You can convert from CSV to Ledger files. There's other commands for that apparently. Um, where was that? That wasn't right. archive. Archiving previous years. After a while, your journal can get very large. It won't slow down ledger. It's designed to process journals very quickly. Um things can start to feel messy. Archive data from previous years into their own files that can offer a sense of completion and freedom for the past. Let's take take an example file. To delete older data from the current ledger file, use print again. Okay, there's a print command. So you're specifying a time range. You want to archive years 200 and 2001 to their own file leading 2002 to 2004 in the current file. So use print to output all the earlier transactions to a file called ledger old.bat. So starting in 200 again 2000 2000 in 2002 the ledger old.bat e limits output to transactions before the date specified. So uh it's not inclusive and then uh you can begin at 2002 to take anything from 2002 forward which will not yield accurate present- day balances. To compensate for this we must append an equity report for the old ledger at the beginning of the new one. So let me actually check this. Can I do an equity report right now? [Music] Um so control c val e I'm just going to edit the bal report and type equity instead. Ah so it gives you an opening balances list based on the current state of all accounts. I think that's cool. So that's something you can copy and paste. I think now the balance reported from ledger.dat are identical to what they were before the data was split. Nice. All says, "I suppose you would set some cashing account to the money you have in your wallet. Do you?" Yeah, it does mention um petty cash. So basically uh you can take money from your checking account and put it into a cash account which is basically like uh the cash that you use to pay elsewhere and you you don't have to track that money. It's just like you turn that account into cash. So, um that's that. And I think that we're basically done. Let me just do one last little check here. transaction format, virtual postings, posting cost, balance verification. Yeah, there's there's all kinds of real like low-level details you can get into here. And like I mentioned before, uh the H Ledger pro program is another one worth looking at if you want kind of more functionality. Um people generally consider it to be uh better than Ledger. I've tried using it in the past. I mean, it's cool. fine. But Ledger does a lot of stuff. I mean, I think you kind you can kind of get the job done uh just with Ledger if you want to. All right, I think that's it. Um hopefully this was interesting and useful to you. Maybe it will inspire you to try a little bit of plain text accounting yourself and to just, you know, understand the ins and outs of um you know, double entry bookkeeping. It's kind of fun. Let me know what you think in the comments. If you have any, you know, suggestions or things that I missed, definitely let me know about them either in the comments or on the forum. I think Ash created the forum post for the stream and had pinned it in the chat. So, go check out the forum and you'll find that post there if you want to leave comments there instead. It it might be better than leaving it on the on the uh the video. That's for sure. And um next week I might not have crafter hour streams because uh we will it's like the Easter season now basically like Easter's happening pretty soon. Greek Easter. So, kids are going to be out of school and it's going to be a little bit untenable. So, uh we will probably be back in a week and a half or possibly two weeks for Craft Hour streams. We'll see how that goes. But I just want to let you know in advance on that. I'll be using that time to work on Geek's course material in the meantime. So, that that should be a good way to make up for that. So, anyway, hope you all have a great weekend. Thank you all for being here today. Really appreciate your time and attention. And until next time, happy hacking. See you.
Video description
In this stream, we'll take a look at a program called Ledger which enables you to perform double-entry bookkeeping with a plain-text format. We'll use Ledger Mode in Emacs to experiment with the features of Ledger and see how it might be useful for personal and business accounting! #emacs #ledger #accounting #plaintext SUPPORT THE CHANNEL: 👍 Support My Work: https://systemcrafters.net/how-to-help/#support-my-work 📰 Subscribe to the Newsletter: https://systemcrafters.net/newsletter/ 👕 Check out the Store: https://systemcrafters.store 📘 Get Your Copy of Mastering Emacs: https://www.masteringemacs.org/r/systemcrafters?utm_source=yt&utm_medium=desc&utm_campaign=scme SHOW NOTES: https://systemcrafters.net/live-streams/april-11-2025/ JOIN THE COMMUNITY: https://systemcrafters.net/community/ (Forum and IRC chat!) https://fosstodon.org/@daviwil MY CONFIGURATION: (This site is currently down but will be back up soon!) https://config.daviwil.com https://config.daviwil.com/emacs https://config.daviwil.com/systems (Guix) OTHER SERIES: - Emacs Essentials: https://www.youtube.com/watch?v=48JlgiBpw_I&list=PLEoMzSkcN8oPZvSdewHG8uApD7THlLLCV - Emacs From Scratch: https://www.youtube.com/watch?v=74zOY-vgkyw&list=PLEoMzSkcN8oPH1au7H6B7bBJ4ZO7BXjSZ - Emacs Tips: https://www.youtube.com/watch?v=wKTKmE1wLyw&list=PLEoMzSkcN8oMHJ6Xil1YdnYtlWd5hHZql - Emacs Desktop Environment: https://www.youtube.com/watch?v=f7xB2fFk1tQ&list=PLEoMzSkcN8oNPbEMYEtswOVTvq7CVddCS - Emacs IDE: https://www.youtube.com/watch?v=E-NAM9U5JYE&list=PLEoMzSkcN8oNvsrtk_iZSb94krGRofFjN - Emacs Mail: https://www.youtube.com/watch?v=yZRyEhi4y44&list=PLEoMzSkcN8oM-kA19xOQc8s0gr0PpFGJQ - Learning Emacs Lisp: https://www.youtube.com/watch?v=RQK_DaaX34Q&list=PLEoMzSkcN8oPQtn7FQEF3D7sroZbXuPZ7 - Craft Your System with GNU Guix: https://www.youtube.com/watch?v=iBaqOK75cho&list=PLEoMzSkcN8oNxnj7jm5V2ZcGc52002pQU CREDITS: Coriolis Effect by logos feat. stefsax, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/mseq/26296 reNovation by airtone, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/airtone/60674 ukeSounds by airtone, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/airtone/32655 Between Worlds (Instrumental) by Aussens@iter, licensed Creative Commons 3.0 CC-BY http://ccmixter.org/files/tobias_weber/56664