Standalone Uganda payroll engine with customizable allowances, PAYE, NSSF, LST, paysheets, and payslips.
Project description
uganda-payroll
Standalone Uganda payroll package built from the payroll patterns in this repository's HRM module, the create_payment_category / paysheet_table treatment, and the January 2026 workbook you shared.
What it supports
basic,gross, ornetdriven payroll requests- Custom payment categories with explicit PAYE, NSSF, cash, and employer-cost behavior
- Existing project-style category natures:
Increment,Deduction,Increment2,Do nothing,Bonus - Resident, non-resident, secondary-employment, and secondary-employment-above-10M modes
- Configurable Uganda PAYE, NSSF, and Local Service Tax policies
- Dynamic paysheet rows and standalone HTML payslip rendering
Install locally
cd packages/uganda-payroll
pip install -e .
Quick example
from uganda_payroll import (
EmployerProfile,
EmployeeProfile,
EmploymentTaxMode,
InputMode,
PayrollCalculator,
PayrollLineItem,
PayrollPeriod,
PayrollRequest,
PaymentCategory,
render_payslip_html,
)
calculator = PayrollCalculator()
overtime = PaymentCategory.from_nature(
code="overtime",
name="Overtime",
nature="Increment",
attracts_paye=True,
attracts_nssf=True,
)
request = PayrollRequest(
employer=EmployerProfile(name="BDO East Africa Advisory Services Ltd", tin="1000943373"),
employee=EmployeeProfile(
full_name="Simon Mukisa",
staff_number="4954",
tin="1019532691",
nssf_number="9317200292098",
department="Advisory",
employment_tax_mode=EmploymentTaxMode.PRIMARY_RESIDENT,
),
period=PayrollPeriod.from_month(year=2026, month=1),
input_mode=InputMode.BASIC_PAY,
target_amount=3_870_000,
items=[
PayrollLineItem(category=overtime, amount=333_000),
],
)
result = calculator.calculate(request)
html = render_payslip_html(result)
print(result.net_pay) # 2829950
print(result.total_paye) # 1162900
print(result.nssf_employee) # 210150
Notes on defaults
- Resident monthly PAYE bands match the workbook logic and the current project formulas.
- Secondary-employment defaults match the current project flags:
30%flat, or40%if all employments exceed UGX 10M. - Non-resident defaults are exposed as configurable tables. The packaged default corrects the evident
0.01typo in the current project logic to0.10for the first bracket. - LST is configurable because collection timing varies by employer and local authority. The default mirrors the existing project's
Chop Once/Chop Four timesbehavior.
Package layout
src/uganda_payroll/models.py: domain objects and category controlssrc/uganda_payroll/policies.py: Uganda PAYE, NSSF, and LST defaultssrc/uganda_payroll/engine.py: payroll calculations and net/gross solvingsrc/uganda_payroll/renderers.py: paysheet rows and HTML payslipstests/test_payroll.py: regression and behavior tests
Project details
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 ugaroll-0.1.0.tar.gz.
File metadata
- Download URL: ugaroll-0.1.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbbed8f528580dc6bb6bd47604ac23b022bf517a57f8cd76f7ee4c2581ef70c8
|
|
| MD5 |
8f4cfb42d4b6f6800efc9771d4663c51
|
|
| BLAKE2b-256 |
e4993bba94cf07cdb77d0a8500a235c79af4cdb10b037aacfd51ed2ae44ea7e9
|
File details
Details for the file ugaroll-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ugaroll-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9faa910904a32be87d3b1e76a583b9636bf203f5c5fcf36ee5f9fc7f020dc1c
|
|
| MD5 |
e771583992c70655b0d7a059b13fe168
|
|
| BLAKE2b-256 |
ad9e89dea0c6d0d30f5ee07226f88a679ccf52c9beae213641f6ce94d70e45f4
|