I built a machine-readable UK Chart of Accounts for Python…
    Neura MarketNeura Market/Stable Diffusion
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityStable DiffusionStable Diffusion
    DeepSeekDeepSeekCoPilotCoPilotMidjourneyMidjourney
    View All Directories
    OverviewPromptsBlogVideosGuidesCoursesCommunityModelsLoRAsComfyUI WorkflowsTrending
    Stable DiffusionBlogI built a machine-readable UK Chart of Accounts for Python (because one didn't exist)
    Back to Blog
    I built a machine-readable UK Chart of Accounts for Python (because one didn't exist)
    python

    I built a machine-readable UK Chart of Accounts for Python (because one didn't exist)

    billkhiz April 1, 2026
    0 views

    Table Of Contents What it does Quick example Why VAT treatments matter The LLM use...

    Table Of Contents

    • What it does
    • Quick example
    • Why VAT treatments matter
    • The LLM use case
    • HMRC box mappings

    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.

    What it does

    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:

    • Account type with double-entry rules (does a debit increase or decrease this account?)
    • VAT treatment (standard 20%, reduced 5%, zero-rated, exempt, or outside scope)
    • HMRC box mappings (CT600, VAT Return, FPS/RTI, EPS, CIS)
    • Tags for searchable grouping (motor, payroll, premises, etc.)
    • Descriptions on complex codes explaining the nuances

    Zero dependencies. Pure Python. Works with Python 3.10+.

    Quick example

    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()
    

    Why VAT treatments matter

    {% card %}

    💡 Why VAT treatments matter

    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:

    TreatmentRateExamples
    Standard20%Most business expenses
    Reduced5%Domestic energy
    Zero-rated0%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%".

    The LLM use case

    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.

    HMRC box mappings

    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.

    Install

    pip install uk-chart-of-accounts
    

    Background

    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 %}

    Tags

    pythonaccountingopensourcefintech

    Comments

    More Blog

    View all
    Context bankruptcy: The case for strategic forgetting for AI Agentsai

    Context bankruptcy: The case for strategic forgetting for AI Agents

    Most of us have seen a coding agent fail to complete a task we know it can do. We just don't...

    J
    James O'Reilly
    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestrationgooglecloud

    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestration

    When building Generative AI applications, developers often encounter a massive bottleneck: sequential...

    A
    Aryan Irani
    Is It Ethical to Post and Ask About Circuits on Dev.to?discuss

    Is It Ethical to Post and Ask About Circuits on Dev.to?

    I’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...

    C
    codebunny20
    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limitsagents

    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limits

    What nobody tells you about exporting your multi-agent prototype to a local workspace. Every...

    L
    leslysandra
    Guarding the till while autonomous data agents do the diggingagenticarchitect

    Guarding the till while autonomous data agents do the digging

    Autonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...

    S
    Sireesha Pulipati
    Return on Attention: Why AI Code Reviews Are Wearing Us Outai

    Return on Attention: Why AI Code Reviews Are Wearing Us Out

    PR 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.

    C
    christine

    Stay up to date

    Get the latest Stable Diffusion prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Stable Diffusion and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Stable Diffusion resource

    • Sync QuickBooks Chart of Accounts to Google BigQueryn8n · $14.99 · Related topic
    • Readable n8n Workflow Export & Multi-Env CI/CD Pipelinen8n · $24.99 · Related topic
    • Monitor Twitter Accounts & Generate AI Intelligence Summaries to Telegramn8n · $24.99 · Related topic
    • Auto-Enrich Salesforce Accounts with Web, LinkedIn & GPTn8n · $24.99 · Related topic
    Browse all workflows