The whole reason I started going down this path was because last year when I was submitting accounts, it asked me if I had prepared accounts in iXBRL format. I hadn't of course (I hadn't "prepared" accounts as such at all), but it was enough to put me in research mode and "ah, yes, GnuCash, iXBRL, all sounds reasonable ... maybe if I have some time next year".
So here we are. As I google these things, I find a lot of things are deprecated and I should use something else instead. Anyway, I ended up here and started following the instructions.
Installing
So this is a python project - not my favourite, it has to be said - but I'm only using it, not trying to debug it. Let's see what happens.$ pip3 install git+https://github.com/cybermaggedon/ixbrl-reporterIt told me to upgrade pip, so I did.
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/cybermaggedon/ixbrl-reporter
Cloning https://github.com/cybermaggedon/ixbrl-reporter to /private/var/folders/sh/l33974n42dd168fg2dvmp600000gn/T/pip-req-build-xz6jyyo
Running command git clone -q https://github.com/cybermaggedon/ixbrl-reporter /private/var/folders/sh/l33974n42dd168fg2dvmp600000gn/T/pip-req-build-xz6jyyo
Resolved https://github.com/cybermaggedon/ixbrl-reporter to commit 0751f8b8dcba2765866350c3b4a95e29f7a8aae9
Collecting requests
Downloading requests-2.32.3-py3-none-any.whl (64 kB)
████████████████████████████████| 64 kB 2.9 MB/s
Collecting lxml
Downloading lxml-5.4.0-cp39-cp39-macosx109x8664.whl (4.4 MB)
████████████████████████████████| 4.4 MB 6.7 MB/s
Collecting piecash
Downloading piecash-1.2.1.tar.gz (769 kB)
████████████████████████████████| 769 kB 7.4 MB/s
Collecting PyYAML
Downloading PyYAML-6.0.2-cp39-cp39-macosx109x8664.whl (184 kB)
████████████████████████████████| 184 kB 8.7 MB/s
Collecting SQLAlchemy<1.5,>=1.0
Downloading SQLAlchemy-1.4.54-cp39-cp39-macosx120x8664.whl (1.6 MB)
████████████████████████████████| 1.6 MB 8.9 MB/s
Collecting SQLAlchemy-Utils!=0.36.8
Downloading SQLAlchemy_Utils-0.41.2-py3-none-any.whl (93 kB)
████████████████████████████████| 93 kB 3.2 MB/s
Collecting pytz
Downloading pytz-2025.2-py2.py3-none-any.whl (509 kB)
████████████████████████████████| 509 kB 8.7 MB/s
Collecting tzlocal
Downloading tzlocal-5.3.1-py3-none-any.whl (18 kB)
Collecting click
Downloading click-8.1.8-py3-none-any.whl (98 kB)
████████████████████████████████| 98 kB 7.0 MB/s
Collecting greenlet!=0.4.17
Downloading greenlet-3.2.1-cp39-cp39-macosx110_universal2.whl (266 kB)
████████████████████████████████| 266 kB 7.4 MB/s
Collecting charset-normalizer<4,>=2
Downloading charsetnormalizer-3.4.1-cp39-cp39-macosx109universal2.whl (197 kB)
████████████████████████████████| 197 kB 7.7 MB/s
Collecting certifi>=2017.4.17
Downloading certifi-2025.4.26-py3-none-any.whl (159 kB)
████████████████████████████████| 159 kB 7.5 MB/s
Collecting urllib3<3,>=1.21.1
Downloading urllib3-2.4.0-py3-none-any.whl (128 kB)
████████████████████████████████| 128 kB 8.3 MB/s
Collecting idna<4,>=2.5
Downloading idna-3.10-py3-none-any.whl (70 kB)
████████████████████████████████| 70 kB 7.2 MB/s
Building wheels for collected packages: ixbrl-reporter, piecash
Building wheel for ixbrl-reporter (setup.py) ... done
Created wheel for ixbrl-reporter: filename=ixbrl_reporter-1.1.2-py3-none-any.whl size=57431 sha256=104e9d08018ffde594cb2d2ebb936c0fd85cd496a3ae36892dcfa51d360f52c7
Stored in directory: /private/var/folders/sh/l33_974n42dd168fg2dvmp600000gn/T/pip-ephem-wheel-cache-bym6oal8/wheels/87/10/24/2a312b06e54c26399ccbf71aa489be34f43f3f765f12e5c4ad
Building wheel for piecash (setup.py) ... done
Created wheel for piecash: filename=piecash-1.2.1-py3-none-any.whl size=64622 sha256=fd57e4966f05c66c2583990ea6102512bcef9100d64d54ba95460f1ab06ba189
Stored in directory: /Users/gareth/Library/Caches/pip/wheels/a0/a2/06/33a71b4c4007e99f46b4e375da1ae745383c8c8495b701a392
Successfully built ixbrl-reporter piecash
Installing collected packages: greenlet, SQLAlchemy, urllib3, tzlocal, SQLAlchemy-Utils, pytz, idna, click, charset-normalizer, certifi, requests, PyYAML, piecash, lxml, ixbrl-reporter
WARNING: The script normalizer is installed in '/Users/gareth/Library/Python/3.9/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script piecash is installed in '/Users/gareth/Library/Python/3.9/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed PyYAML-6.0.2 SQLAlchemy-1.4.54 SQLAlchemy-Utils-0.41.2 certifi-2025.4.26 charset-normalizer-3.4.1 click-8.1.8 greenlet-3.2.1 idna-3.10 ixbrl-reporter-1.1.2 lxml-5.4.0 piecash-1.2.1 pytz-2025.2 requests-2.32.3 tzlocal-5.3.1 urllib3-2.4.0
WARNING: You are using pip version 21.2.4; however, version 25.1 is available.
You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command.
$ /Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pipThis also wants me to upgrade pip, but since I've just done it, I have to assume that's a bug.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages (21.2.4)
Collecting pip
Downloading pip-25.1-py3-none-any.whl (1.8 MB)
████████████████████████████████| 1.8 MB 5.2 MB/s
Installing collected packages: pip
WARNING: The scripts pip, pip3 and pip3.9 are installed in '/Users/gareth/Library/Python/3.9/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-25.1
WARNING: You are using pip version 21.2.4; however, version 25.1 is available.
You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command.
Generating Accounts
Following on in the instructions, it says I will need to clone the repository to obtain some configuration files.I can do that.
$ git clone https://github.com/cybermaggedon/ixbrl-reporterAnd then I should be able to generate my accounts from that. Starting with what they have given me, let's try that.
Cloning into 'ixbrl-reporter'...
remote: Enumerating objects: 1924, done.
remote: Counting objects: 100% (225/225), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 1924 (delta 205), reused 198 (delta 195), pack-reused 1699 (from 1)
Receiving objects: 100% (1924/1924), 1.62 MiB | 7.15 MiB/s, done.
Resolving deltas: 100% (1401/1401), done.
$ cd ixbrl-reporter/OK, yes that works. But everything starts to descend into hell from here.
$ ~/Library/Python/3.9/bin/ixbrl-reporter config.yaml report ixbrl > accts.html
$ open accts.html
Customizing the Reports
I was under the impression that the configuration here was all about customizing the form you wanted to generate. And I thought that once I had my data in GnuCash, everything would be fine. Oh, I was so wrong.Apparently all of your company data needs to be put in the configuration files.
And you need to customize the years that you want the reporting to be for as well. At some level, this is not unreasonable, but it feels like "the year you want" is a different level of option to "this is the way my accounts are structured".
A whole bunch of other stuff which in my mind is "accounting" related, is also in the configuration files.
Also, reading from GnuCash files directly is not supported on a Mac. I could go to Linux, but apparently it is possible to use a CSV file. I can export from GnuCash to CSV, but now I'm asking myself why I put so much effort into generating GnuCash XML files if I'm only using that to generate CSV files.
But at the end of the day, with much hacking, I managed to generate both a set of accounts and a CT600 in iXBRL format that looked valid and similar to what I had last year. I don't really feel that it's worth even recording the kinds of things that I did, because this is not really a scalable way to proceed.
Submitting the Reports
As I said at the top of this episode, the whole reason that I started going down this path was because I thought I could now submit these forms directly. The accounts, yes; the tax forms, no. Ah.It turns out that there is a further program, ct600 which is capable of doing something like this and working with the HMRC API. But there are two sentences in its description which stop me going there:
- "This probably won't do what you want"
- "The first step is to use ct600 to create what I am calling a 'form values' file"
Conclusion
I feel I have walked around four sides of a block trying to automatically submit my accounts and CT600 and have done endless transformations to get ... nowhere.Well, not quite nowhere. Further on, the ct600 README suggests doing this:
"See Company Tax Returns and Corporation Tax online: support for software developers."
Which makes me realize that while I have gone down a false path, not all the work I have done needs to be thrown away.
I want to be clear that I haven't spent "that much" time doing all this - it's less than a week since I started and I've been working anything but full-time on it. But I have certainly wasted time trying to integrate with GnuCash, because it is a false trail. But it's worth pointing out that while I tried to take risks early, I should have used my "hand-built" GnuCash file to try out the ixbrl-reporter and ct600 scripts sooner. Had I done that, I would have reached this point without having to write all the GnuCash XML code that I found so painful.
Next Steps
On the bright side, I have done the following things that I consider useful:- Collected together all my company accounts and records in a single Google Sheet;
- Used GnuCash as a model of how to build that as a reasonable set of "Account"s that can be manipulated into accounts and corporation tax filing;
- Built code to read the configuration and spreadsheet, and to calculate account values.
Fortunately, I have until Dec 31 to submit my accounts and, if all else fails, I can submit them "by hand" this year (although apparently that facility is going away next year).
I now need to go ahead and understand what it means to use the Government Gateway to submit these documents. More reading ahead!
No comments:
Post a Comment