Open-source Malaysian statutory rate data — EPF, SOCSO, EIS, PCB, minimum wage, HRDF, public holidays. Scraper + data only.
Project description
Malaysia Statutory Rates
Malaysian statutory rate data — EPF, SOCSO, EIS, PCB, minimum wage, HRDF, public holidays.
Data only, no calculation engine.
Install
pip install malaysia-statutory-rates
For scraping:
pip install malaysia-statutory-rates[scraper]
Quick Start
Python
from malaysia_statutory_rates import load_rates
rates = load_rates()
# EPF rates
epf = rates["epf_rates"]
employee_rate = epf["rates"]["malaysian_pr_nonmy_before_aug98_below_60"]["employee"]["rate"] # 0.11
employer_rate = epf["rates"]["malaysian_pr_nonmy_before_aug98_below_60"]["employer"]["wage_lte_5000"]["rate"] # 0.13
# Minimum wage
mw = rates["minimum_wage"]
min_salary = mw["rates"]["nationwide"]["monthly"] # 1700
# SOCSO wage ceiling
socso = rates["socso_rates"]
ceiling = socso["wage_ceiling"] # 6000
# Public holidays
holidays = rates["public_holidays"]
national = [h for h in holidays["holidays"] if h.get("national")]
CLI
malaysia-statutory-rates show
malaysia-statutory-rates show epf
malaysia-statutory-rates show holidays
malaysia-statutory-rates scrape --all
Data Files
| File | Source | Content |
|---|---|---|
data/epf_rates.json |
kwsp.gov.my | EPF contribution rates by citizenship, age, wage bracket |
data/socso_rates.json |
perkeso.gov.my + booklet PDF | SOCSO metadata + 65-bracket rate table (2 schedules) |
data/eis_rates.json |
perkeso.gov.my + booklet PDF | EIS metadata + 65-bracket rate table |
data/pcb_table.json |
LHDN e-CP39 | PCB/MTD tax brackets and reliefs |
data/minimum_wage.json |
gajiminimum.mohr.gov.my | Minimum wage (monthly + hourly) |
data/hrdf_rates.json |
hrdcorp.gov.my | HRDF levy rates and formula |
data/public_holidays.json |
publicholidays.com.my | National + state public holidays |
data/foreign_worker_rates.json |
Derived | EPF/SOCSO/EIS rates for foreign workers |
Scraping
Scrapers fetch data from government websites. httpx is used first; blocked sites (kwsp.gov.my, hrdcorp.gov.my) fall back to Firecrawl.
Setup
pip install malaysia-statutory-rates[scraper]
cp .env.example .env # add Firecrawl API key if needed
Run
malaysia-statutory-rates scrape --all
from malaysia_statutory_rates.scrapers import run_scrapers
results = run_scrapers() # {"epf_rates": True, "minimum_wage": False, ...}
How it works
- Checks local cache (
.cache/fetch/) — returns if < 24h old - Checks
robots.txt— skips if disallowed - Tries httpx first (no API cost)
- Falls back to Firecrawl on 403/429 or JS-only pages (1 credit)
- Caches responses for 24 hours
- Writes to
data/*.jsonwith_metadata(scraped_at, source) - Change detection — only writes if data changed
Sources
| Source | Method | Notes |
|---|---|---|
| kwsp.gov.my (EPF) | Firecrawl fallback | Returns 403 to httpx |
| perkeso.gov.my (SOCSO/EIS) | httpx + PDF parse | Metadata from HTML; rate tables from booklet PDF |
| gajiminimum.mohr.gov.my | httpx | Minimum wage gazette |
| hrdcorp.gov.my (HRDF) | Firecrawl fallback | JS SPA — httpx gets empty shell |
| publicholidays.com.my | httpx | Third-party, scrapes table |
| LHDN (PCB) | Manual | e-CP39 requires login |
Scraper Status
| Scraper | Status | Data Source |
|---|---|---|
minimum_wage.py |
Done | HTML |
hrdf.py |
Done | Firecrawl HTML |
holidays.py |
Done | HTML |
epf.py |
Done | HTML |
socso.py |
Done | HTML + PDF |
eis.py |
Done | HTML + PDF |
pcb.py |
Done | PDF download + metadata (data manually verified against LHDN spec) |
foreign_worker_rates.json |
Done | Derived from EPF/SOCSO/EIS |
PDF Parsing
SOCSO and EIS rate tables (65 wage brackets each) are parsed from the PERKESO 2025 Booklet using pymupdf. Pages 36–39 for Act 4, 52–55 for Act 800.
Cached at .cache/pdf/2025-BOOKLET_PERKESO_BI.pdf.
Disclaimer
Data scraped from official government websites. Verify rates against official sources before making payroll or tax decisions.
License
MIT
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 malaysia_statutory_rates-0.1.0.tar.gz.
File metadata
- Download URL: malaysia_statutory_rates-0.1.0.tar.gz
- Upload date:
- Size: 456.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00c112093a3875b826b5a1a33b315c7723df9de69466b805462efa3635969893
|
|
| MD5 |
2040811716d3934895242f90abb0720b
|
|
| BLAKE2b-256 |
048f33a38e5a3f2494667dd60490838c399af4a5cf357a78caf026d382cd3a12
|
File details
Details for the file malaysia_statutory_rates-0.1.0-py3-none-any.whl.
File metadata
- Download URL: malaysia_statutory_rates-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
521b1fc4b7b0f119ff58f132f56b8a8210578a8431557b6745ba7ea1d088f4d9
|
|
| MD5 |
33f847540176b0e52b92835abe7f1454
|
|
| BLAKE2b-256 |
341ee9fc081de17927598f1f4ed2fe8bb8a856670754dd29f911091bb7163dee
|