Feasability of using ledger an co. for small business accounting automation

81 views
Skip to first unread message

Tom.PLAA

unread,
Feb 16, 2021, 7:40:30 AM2/16/21
to Ledger
Hello everyone,

I've recently come across ledger and the concept of PTA and I amvery intrigued.

As I am not an experienced programmer nor have a software engineering background, I am eager to see your opinions on how realistic it is to use ledger (or one of its brothers) to help industrialize accounting and/or book-keeping for a small business.
My idea is roughly to use ledger as the "backend" and find some way to automate most of the data insertions - maybe by parsing bank extracts and automating the "add" function to the main transaction data file (thinking about using it as a single file for all book-keeping now, as suggested in the hledger FAQ).

My main goals for this particular task are:
  1. Spend zero money on accounting software and use something I can read the code of;
  2. Minimize manual transaction recording and general book-keeping tasks;
  3. Be able to produce clean reports and export data to give to an accountant (hoping I can strike some deal where an accountant will lower the fees if I provide clean data and reduce their worload).

As this been done, and if so, how feasible is it to maintain?

Is ledger a good choice for the tasks mentioned above, or is hledger (or another project) better suited for this?


Thank you for the attention,

Tomás



o1bigtenor

unread,
Feb 16, 2021, 11:13:03 AM2/16/21
to Ledger
On Tue, Feb 16, 2021 at 6:40 AM Tom.PLAA <tomasal...@gmail.com> wrote:
>
> Hello everyone,
>
> I've recently come across ledger and the concept of PTA and I am very intrigued.
>

What is PTA please?

TIA

Tomás de Almeida

unread,
Feb 16, 2021, 11:14:27 AM2/16/21
to ledge...@googlegroups.com
Plaintext accounting.

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/CAPpdf59uXURQZ_w9VxM3MtsT9umz4F-vxv1zvK5CSXd4%3DPXUeA%40mail.gmail.com.

o1bigtenor

unread,
Feb 16, 2021, 11:16:16 AM2/16/21
to Ledger
On Tue, Feb 16, 2021 at 10:14 AM Tomás de Almeida
<tomasal...@gmail.com> wrote:
>
> Plaintext accounting.
>
> On Tue, 16 Feb 2021, 16:13 o1bigtenor, <o1big...@gmail.com> wrote:
>>
>> On Tue, Feb 16, 2021 at 6:40 AM Tom.PLAA <tomasal...@gmail.com> wrote:
>> >
>> > Hello everyone,
>> >
>> > I've recently come across ledger and the concept of PTA and I am very intrigued.
>> >
>>
>> What is PTA please?
>>
>> TIA
>>

Thank you!

Dániel Fancsali

unread,
Feb 16, 2021, 11:34:06 AM2/16/21
to Ledger
OMG! Finally we have a proper TLA for it... ;)

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

Tomás de Almeida

unread,
Feb 16, 2021, 11:43:39 AM2/16/21
to ledge...@googlegroups.com
I saw the acronym used on plaintextaccounting.org so I assumed it was commonly used.

Kent R. Spillner

unread,
Feb 16, 2021, 12:15:18 PM2/16/21
to ledge...@googlegroups.com
> As this been done, and if so, how feasible is it to maintain?

Yes, definitely! I've been using ledger to manage the books for my wife's small
business this past year. Make sure you take the time to read Ledger's manual
(https://www.ledger-cli.org/docs.html), and also browse https://plaintextaccounting.org/

> Is ledger a good choice for the tasks mentioned above, or is hledger (or another project) better suited for this?

Yes to both. I've just been using ledger myself since it suits my needs (I just dump
out a csv file at the end of the year and send that to our tax preparer) and haven't
actually used hledger at all, but my understanding is that hledger parses ledger's
file format without issue. So you can use both, freely switching back-and-forth
between them as needed. (That's the beauty of PTA, right? ;))


Tomás de Almeida

unread,
Feb 16, 2021, 2:20:09 PM2/16/21
to ledge...@googlegroups.com
Thank you very much for your answer, Kent, that is very encouraging indeed!
I will try to tackle this challenge and see how far I can go with ledger to automate our accounting.

Cheers,
Tomás

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

Colin Dean

unread,
Feb 17, 2021, 12:28:37 AM2/17/21
to Ledger
I've got some custom code in a Sinatra app written in Ruby that's taking Stripe webhook posts, transforming them into Ledger records, and submitting them as PRs on a GitLab repo. It's slick... when it works. GitLab's "merge on successful CI build" doesn't always work and multiple open PRs turn into a merge conflict exponential nightmare. The downside is that Stripe doesn't seem to include fee information on these posts so I have to go back into Stripe once in a while to look up fees. It's not so bad for the ~5-10 txns per month I see normally but when there are bursts of 40-50 in a month, it's another task on the procrastination pile.

Most of my "automation" is using ledger-autosync to manually monthly or quarterly sync CSVs, etc. I downloaded and cleaned up. I have only one financial institution in my life that provides clean CSV output, sigh.

Tomás de Almeida

unread,
Feb 17, 2021, 10:04:37 AM2/17/21
to ledge...@googlegroups.com
Thanks for your input Colin.

I was thinking about doing something very simple and barebones. Akin to having job that extracts and parses daily transaction reports from the company's bank account into the main ledger data file. 

I imagine some of the transactions would be easy to automate as writing them into the proper category: repeat customers, periodic fees of subscribed services, etc.

The "new" transactions would always be a mistery on which category they should be parsed, so they would go into a "to insert manually later" file that we would hsve to take a look from time to time.

It would be impossible to automate book-keeping 100% this way, but if we could at least eliminate having to manually insert the predictable ones (server costs, office costs, salaries) I believe it would save us some buraucracy.

What do you think?

--

---
You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/ODCt1PM1oJc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/cca73f98-00f3-4e73-b3eb-c85d1ea9c835n%40googlegroups.com.

Fergus Cameron

unread,
Feb 17, 2021, 10:50:15 AM2/17/21
to ledge...@googlegroups.com
I ran a consultancy business using PTA for many years and suggest your
strategy is the wisest. Do not think to eliminate your book-keeping;
you MUST be engaged with it day-to-day. But certainly take the
monotony out of it with the types of automation you mention. Add the
the outstanding reporting that ledger-likes afford and you will be
have off to a good start, I believe.

However, be careful. Accounting is a legal practice and it is very
easy, even with good tools to end up, "in the woods". Tools like
ledger are liberating but "process" remains important.

One item of context. DO NOT pick a business tool because it is free.
Ever. This will not be a win unless the cost is so exorbitant that it
gives you enormous competitive advantage ON TOP of your "real"
business (i.e. without impinging on it).

Good luck.

--
NB: of course I do not direct such advice AT you but share simply
because I have burnt myself many times and whilst I would still
encourage you, I do so with caution.

o1bigtenor

unread,
Feb 17, 2021, 11:24:16 AM2/17/21
to Ledger
On Wed, Feb 17, 2021 at 9:50 AM Fergus Cameron <tofe...@gmail.com> wrote:
>
> I ran a consultancy business using PTA for many years and suggest your
> strategy is the wisest. Do not think to eliminate your book-keeping;
> you MUST be engaged with it day-to-day. But certainly take the
> monotony out of it with the types of automation you mention. Add the
> the outstanding reporting that ledger-likes afford and you will be
> have off to a good start, I believe.
>
snip

I would disagree - - - - if you do your recordkeeping ever day and are checking
your emails every hour (or when you get your beep on that stupid phone) and
when you get a text you are reading it pdq - - - - well your business
is running YOU.
You need to run your business!
To me - - - - once a week for as long as it takes - - - - I want to
get that record-
keeping done.
Trying to discipline myself to emails 2x per day.
Texts - - - I live where reception is like finding honest politicians so that's
really not an issue.
>
> One item of context. DO NOT pick a business tool because it is free.
> Ever. This will not be a win unless the cost is so exorbitant that it
> gives you enormous competitive advantage ON TOP of your "real"
> business (i.e. without impinging on it).
>
Ditto that - - - but - - - - I would always look for value - - - -
long term value
in fact. Its something that doesn't seem on the radar for many individuals
and far fewer commercial entities - - - - at least here in north america.

Tomás de Almeida

unread,
Feb 17, 2021, 2:17:50 PM2/17/21
to ledge...@googlegroups.com
Thank you for you advice and remarks, Fergus.

In this case, cost of the tools is significant for our starting financial position, so I was searching within the free alternatives realm, and after some days of research I ended up with ledger as the strongest contender, because its minimalistic mindset and quickness of procedure is exactly what I had in mind.

On some fronts, we have come to accept that paying for the service is the wisest choice. We are still conceptualizing and designing our infrastructure, so we see every task on a case by case basis, but try to plan for automation as much as safely possible. It's very tough to figure out what is feasible or not without spending weeks of research, hence why I felt inclined to reach out to this mailing list (my first time using one).

We are close to o1bigtenor's mindset, where we are just trying to avoid the common pitfalls of most companies that don't take the time and effort to plan ahead and make themselves more agile (not in the corporate meme sense).

I personally believe that, in a possible scaling scenario, I would rather have one or two bright persons within our team working on improving automating procedures than having 10 employees doing exclusively bureaucratic tasks. But we suspect that has to start being built from the get-go. If we get lazy because we are very small now (and thus it's easy to do one or two calculation sheets per week) we will probably find ourselves deep in the mud along the line, spending more time doing administrative work than thinking creatively about the actual problems.

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/CAPpdf58reU1_Kj1zufSkN6gFWob-XZsM1TFqgH2b7DQyx%2Bjueg%40mail.gmail.com.

federico lopez

unread,
Feb 18, 2021, 5:46:24 AM2/18/21
to ledge...@googlegroups.com
On Wed, Feb 17, 2021 at 10:04 AM Tomás de Almeida <tomasal...@gmail.com> wrote:
Thanks for your input Colin.

I was thinking about doing something very simple and barebones. Akin to having job that extracts and parses daily transaction reports from the company's bank account into the main ledger data file. 

I imagine some of the transactions would be easy to automate as writing them into the proper category: repeat customers, periodic fees of subscribed services, etc.


Another simple one using sed:
 
Say you can export from the bank in this format:

bankExtract.txt
2021-02-01 SOME TRANSACTION FEE  $87.77
...

textToLedger_sed_commands.sed
## s/[[:space:]]\+/ /g  ## uncomment to convert tabs to spaces
s/SOME TRANSACTION FEE/* Bank fee  \n    ; someMetadata: someValue \n    myCategory:mySubCategory    /g
/Bank fee/ s/$/\n    bankName\n\n/

textToLedger.sh
#!/bin/bash
f1=~/path/to/bankExtract.txt
f2=~/path/to/bankExtract_processed.ldg
tsed -f ~/path/to/script/textToLedger_sed_commands.sed $f1 > $f2
cat $f2

> 2021-02-01 * Bank fee 
    ; someMetadata: someValue
    myCategory:mySubCategory      $87.77
    bankName
 
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/CABO43G1poiUa1Dj7Khv05LLeo63ydYDoWU72qufWeNzaj2atpA%40mail.gmail.com.

federico lopez

unread,
Feb 18, 2021, 5:57:45 AM2/18/21
to ledge...@googlegroups.com


On Thu, Feb 18, 2021 at 5:46 AM federico lopez <fede...@gmail.com> wrote:

sorry my typo
tsed -f ~/path/to/script/textToLedger_sed_commands.sed $f1 > $f2

the correct line is:
sed -f ~/path/to/script/textToLedger_sed_commands.sed $f1 > $f2

Tomás de Almeida

unread,
Feb 18, 2021, 1:36:24 PM2/18/21
to ledge...@googlegroups.com
Thank you very much, Federico, I will take a close look st your suggestions.

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

o1bigtenor

unread,
Feb 18, 2021, 3:17:40 PM2/18/21
to Ledger
On Thu, Feb 18, 2021 at 12:36 PM Tomás de Almeida
<tomasal...@gmail.com> wrote:
>
> Thank you very much, Federico, I will take a close look st your suggestions.
>
> On Thu, 18 Feb 2021, 10:57 federico lopez, <fede...@gmail.com> wrote:

> --
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>>
>>
>>
>> On Thu, Feb 18, 2021 at 5:46 AM federico lopez <fede...@gmail.com> wrote:
>>
>> sorry my typo
>>>
>>> tsed -f ~/path/to/script/textToLedger_sed_commands.sed $f1 > $f2
>>
>>
>> the correct line is:
>> sed -f ~/path/to/script/textToLedger_sed_commands.sed $f1 > $f2
>>
>>
This forum has also at times given me serious assistance.
I had to modify what was proffered but I was given a starting point
and from that I came up with what I needed.
That was for creating reports (account # xxxx.xx.xx.xx (in my case)
had $yyyy on these dates and this much for the requested period).
Great for filling out my tax forms!!

Regards

Richard Lawrence

unread,
Feb 21, 2021, 2:53:23 AM2/21/21
to Tomás de Almeida, ledge...@googlegroups.com
Tomás de Almeida <tomasal...@gmail.com> writes:

> I was thinking about doing something very simple and barebones. Akin to
> having job that extracts and parses daily transaction reports from the
> company's bank account into the main ledger data file.
>
> I imagine some of the transactions would be easy to automate as writing
> them into the proper category: repeat customers, periodic fees of
> subscribed services, etc.
>
> The "new" transactions would always be a mistery on which category they
> should be parsed, so they would go into a "to insert manually later" file
> that we would hsve to take a look from time to time.

I don't have any experience using ledger to manage a business, but I
thought it would be useful to add here that you shouldn't underestimate
the power of a good text editor to help with this automation.
Customizing your editor to help with data entry can save you a lot of
time and effort without taking a human who has all the necessary context
out of the loop.

For example, I use ledger-mode for Emacs, which provides great features
like completion of account names. I also have various abbrevs setup for
common transactions, so that I can just type e.g. "atm" and get a
transaction filled out for a typical ATM withdrawal, for which I can
then adjust the amount if necessary. I have written custom commands to
automate other things too, like adding the exchange rate on a certain
date. You can go really far with this kind of
mostly-automated-but-human-adjusted data entry.

Writing custom scripts can be a lot of work (depending on what the
incoming data looks like) and as you note, there will probably be many
cases where more context is needed to categorize something properly. At
least for me personally, it works better to start with editor
customization, and only move to a fully-automated script in cases where
I'm sure I will not need to do any manual review.

--
Best,
Richard

Tomás de Almeida

unread,
Feb 22, 2021, 5:37:00 AM2/22/21
to Richard Lawrence, ledge...@googlegroups.com
Thank you Richard.
Starting to learn Emacs has been on my list for a while now, so I guess this is a good chance as any!
Reply all
Reply to author
Forward
0 new messages