
Table Of Contents What it does Quick example Why VAT treatments matter The LLM use...
If you've ever tried to build accounting software for the UK market, you've hit the same wall I did: there's no clean, machine-readable UK Chart of Accounts available on PyPI.
US-centric ones exist. Plenty of them. But UK accounting has different categories, VAT treatments, and HMRC-specific codes that don't map neatly onto American standards.
So rejoice UK accountants, I built one.
uk-chart-of-accounts is a Python library with 166 standard UK nominal codes - the numbered category system every UK business uses to classify transactions. Each code includes:
Zero dependencies. Pure Python. Works with Python 3.10+.
from uk_coa import ChartOfAccounts, VatRate
coa = ChartOfAccounts()
# Look up any nominal code
account = coa.get(7602)
account.name # "Accountancy Fees"
account.vat # VatRate.STANDARD
account.vat_rate_pct # 0.20
account.debit_increase # True
# Search
coa.search("insurance") # All accounts with "insurance" in the name
coa.by_vat(VatRate.EXEMPT) # All VAT-exempt accounts
coa.by_tag("motor") # All motor-related accounts
# Export for LLM prompts
context = coa.to_prompt_context()
{% card %}
Getting this wrong means incorrect VAT returns. This library has every code's VAT treatment pre-set, including nuances like residential vs. commercial rent. {% endcard %}
Different expenses have different treatments:
| Treatment | Rate | Examples |
|---|---|---|
| Standard | 20% | Most business expenses |
| Reduced | 5% | Domestic energy |
| Zero-rated | 0% | Books, children's clothes |
| Exempt | - | Insurance, bank charges, Royal Mail postage |
| Outside scope | - | Wages, taxes, depreciation |
This is the part most non-UK developers get wrong. UK VAT isn't just "add 20%".
If you're building AI-powered bookkeeping tools, the to_prompt_context() method formats the entire chart as structured text you can inject into an LLM prompt:
# Feed the chart to an LLM for transaction categorisation
context = coa.to_prompt_context(types=[AccountType.OVERHEAD])
prompt = f"""Given this chart of accounts:
{context}
Categorise this transaction: "TESCO 15.40 GBP"
"""
This gives the model the full code structure, names, and VAT treatments without you having to maintain prompt templates.
Each code references the HMRC form and box it feeds into:
corp_tax = coa.get(2110)
corp_tax.hmrc_box # "CT600 Box 86"
entertainment = coa.get(7403)
entertainment.hmrc_box # "CT600 Box 46"
entertainment.description
# "VAT on business entertainment is blocked from input tax
# recovery (HMRC VAT Notice 700/65). Disallowable for
# corporation tax - must be added back on CT600."
Mappings cover CT600, VAT Return (Boxes 1-9), FPS/RTI, EPS, and CIS returns.
pip install uk-chart-of-accounts
I'm a finance professional who builds AI tools for UK accounting. This library came from extracting the reference data layer of a larger bookkeeping automation project. The codes, VAT treatments, and HMRC mappings are standard public knowledge - I've just packaged them in a way that's actually usable in code.
{% cta https://github.com/billkhiz-bit/uk-chart-of-accounts %} Star the repo or open a PR {% endcta %}
{% embed https://github.com/billkhiz-bit/uk-chart-of-accounts %}
aiMost of us have seen a coding agent fail to complete a task we know it can do. We just don't...
googlecloudWhen building Generative AI applications, developers often encounter a massive bottleneck: sequential...
discussI’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...
agentsWhat nobody tells you about exporting your multi-agent prototype to a local workspace. Every...
agenticarchitectAutonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...
aiPR volume went up, ticket quality didn't, and the gap got filled with LLMs on both sides of the review: bots reviewing, bots replying, bots occasionally arguing with bots about priorities that only existed in a teammate's head. Our CEO named the actual problem, and it's bigger than code review.
Workflows from the Neura Market marketplace related to this Stable Diffusion resource