An implementation of UK income tax Pay-As-You-Earn calculations
Project description
PAYE
Implementation of UK Income Tax Pay-As-You-Earn algorithms
In the UK, many employees and pensioners pay income tax in weekly or monthly installments as a deduction on their payslip under a system known as Pay-As-You-Earn or PAYE.
In this system, His/Her Majesty's Revenue and Customs (HMRC) gives the employer/pension provider a "Tax Code" which they use to calculate how much income tax to deduct.
This package implements the algorithms for calculating the income tax due as defined by HMRC in their "SPECIFICATION FOR PAYE TAX TABLE ROUTINES" Version 24, dated January 2026
HMRC Constants
The algorithms use a set of constants that are dependent on tax year and defined in the Specification.
This package reads the constants from a TOML file 'hmrc.toml' which needs to be updated for each new tax year.
Exported Objects
- the TaxCode class
- the Payslip class
- utility functions str_to_decimal and uk_tax_period_start_date
Usage
Weekly vs Monthly pay is selected by the environment variable PAYE_PERIOD: PAYE_PERIOD=weekly or PAYE_PERIOD=monthly
if unset, monthly is assumed
The inputs are:
- Your basic pay for the week / month
- Your tax code for the week / month (as given by HMRC via a letter or your Personal Tax Account on gov.uk)
- Any pay adjustments for the week / month (e.g. bonus)
- Any payrolled benefits in kind ... and for cumulative tax codes;
- The tax period number
- Your total gross pay for the tax year including this week / month
- The income tax you've paid so far this tax year, NOT including this week/month
Use these to create an instance of the Payslip class
The income tax for this week / month is provided by the income tax property of the payslip.
Testing
This module is validated against the test cases provided by HMRC
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paye-0.5.0.tar.gz.
File metadata
- Download URL: paye-0.5.0.tar.gz
- Upload date:
- Size: 92.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.14.4 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f4ab5e74d794d872b9b20cb277217b1b3bb8a32ab60b1e437b8b1f8e81f728f
|
|
| MD5 |
e87bea0a8cbbd15795eaa7c929b909c2
|
|
| BLAKE2b-256 |
7cb6af939f514cc8def11a21daecdd1773a884194d470e639de6589f9af98c91
|
File details
Details for the file paye-0.5.0-py3-none-any.whl.
File metadata
- Download URL: paye-0.5.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.14.4 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
899a8871a5ca95880864eb38a73cbad6aa544691d38f245f34f09aed7d1e6e36
|
|
| MD5 |
2493df2d4185e7717f531d5ad9b763b0
|
|
| BLAKE2b-256 |
fa303fd2414801accf2a9a8cd6ba26af57edf1fa4c8b1690670744304989438a
|