Skip to main content

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, or net driven 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, or 40% if all employments exceed UGX 10M.
  • Non-resident defaults are exposed as configurable tables. The packaged default corrects the evident 0.01 typo in the current project logic to 0.10 for 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 times behavior.

Package layout

  • src/uganda_payroll/models.py: domain objects and category controls
  • src/uganda_payroll/policies.py: Uganda PAYE, NSSF, and LST defaults
  • src/uganda_payroll/engine.py: payroll calculations and net/gross solving
  • src/uganda_payroll/renderers.py: paysheet rows and HTML payslips
  • tests/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

ugaroll-0.1.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ugaroll-0.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

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

Hashes for ugaroll-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dbbed8f528580dc6bb6bd47604ac23b022bf517a57f8cd76f7ee4c2581ef70c8
MD5 8f4cfb42d4b6f6800efc9771d4663c51
BLAKE2b-256 e4993bba94cf07cdb77d0a8500a235c79af4cdb10b037aacfd51ed2ae44ea7e9

See more details on using hashes here.

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

Hashes for ugaroll-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9faa910904a32be87d3b1e76a583b9636bf203f5c5fcf36ee5f9fc7f020dc1c
MD5 e771583992c70655b0d7a059b13fe168
BLAKE2b-256 ad9e89dea0c6d0d30f5ee07226f88a679ccf52c9beae213641f6ce94d70e45f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page