dayrule

v0.1.0
io.github.CloudCorpRecords/dayrule Checked 2 days ago Published 17 days ago

NZ working-day math with the law section cited, holidays, and IRD, NZ bank and ABN checks.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

add_working_days

Add (or subtract) working days under a NZ statute's definition. Returns the date, the section cited and the holidays skipped. The start date is not counted.

ParameterTypeDescription
days *integerNumber of working days to add; a negative number subtracts.
rule *stringWorking-day rule name, e.g. 'holidays-act' (see list_rules).
start_date *stringDate to start from, YYYY-MM-DD. The start date is not counted.
jurisdictionstringJurisdiction whose rules apply (default 'NZ').
regionOptional region, e.g. 'wellington'.

count_working_days

Count working days after from_date up to and including to_date under a rule.

ParameterTypeDescription
from_date *stringStart of the range; working days are counted after this date.
rule *stringWorking-day rule name, e.g. 'holidays-act' (see list_rules).
to_date *stringEnd of the range, inclusive.
jurisdictionstringJurisdiction whose rules apply (default 'NZ').
regionOptional region, e.g. 'wellington'.

list_rules

List the working-day rules with their section reference, text and version.

ParameterTypeDescription
jurisdictionstringJurisdiction whose rules to list (default 'NZ').

nz_holidays

NZ public holidays (actual and observed dates) and provincial anniversary days for a year (2020-2030). Optional region, e.g. 'wellington'.

ParameterTypeDescription
year *integerYear to list holidays for (2020-2030).
jurisdictionstringJurisdiction (default 'NZ').
regionOptional region for provincial anniversary days, e.g. 'wellington'.

validate_ird

Free: check an NZ IRD number's check digit (Inland Revenue written steps; IRD's Example 3, 150000026, contradicts those steps and is reported invalid).

ParameterTypeDescription
number *stringThe NZ IRD number to check.
jurisdictionstringJurisdiction (default 'NZ').

validate_nz_bank

Free: check an NZ bank account number (Inland Revenue algorithm). Checksum only; branch not verified against the Payments NZ register.

ParameterTypeDescription
account *stringThe NZ bank account number to check.
jurisdictionstringJurisdiction (default 'NZ').

validate_abn

Free: check an Australian Business Number's checksum (ABR algorithm).

ParameterTypeDescription
abn *stringThe Australian Business Number to check.
jurisdictionstringJurisdiction (default 'AU').