I built a machine-readable UK Chart of Accounts for Python…
    Neura MarketNeura Market/Perplexity
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityTrending
    PerplexityBlogI 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
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    Stay up to date

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

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Perplexity 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.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Perplexity resource

    • Automate SEO-Optimized Blog Creation with GPT-4, Perplexity AI & Multi-Language Supportn8n · $24.99 · Related topic
    • Automate SEO Blog Content Creation with GPT-4, Perplexity AI, and WordPressn8n · $24.99 · Related topic
    • Automate SEO Blog Creation + Social Media with GPT-4, Perplexity, and WordPressn8n · $24.99 · Related topic
    • Auto-Generate SEO Blog Posts with Perplexity, GPT, Leonardo & WordPressn8n · $14.99 · Related topic
    Browse all workflows