| Did you know ... | Search Documentation: |
| Packs (add-ons) for SWI-Prolog |
| Title: | Statutory employer costs, 76 countries |
|---|---|
| Rating: | Not rated. Create the first rating! |
| Latest version: | 0.1.0 |
| SHA1 sum: | b0f17d9b7001759660d45cb078b22b7fc62df67c |
| Author: | EOR Scope Research <research@eorscope.com> |
| Home page: | https://eorscope.com/eor-cost-calculator/ |
| Download URL: | https://github.com/eorscope/eorscope_employer_costs.git |
No reviews. Create the first review!.
| Version | SHA1 | #Downloads | URL |
|---|---|---|---|
| 0.1.0 | b0f17d9b7001759660d45cb078b22b7fc62df67c | 1 | https://github.com/eorscope/eorscope_employer_costs.git |
SWI-Prolog pack that embeds the EOR Scope dataset of statutory employer costs, as read-only dict records. No dependencies, no network calls.
swipl pack install https://github.com/eorscope/eorscope_employer_costs.git
:- use_module(library(eorscope_employer_costs)).
?- country(de, DE), get_dict(employer_cost_pct_printed, DE, Pct).
?- contributions("DE", Lines). % [] for an unknown code
?- countries_in_region("Europe", Cs).
?- regions(Rs).
?- assumptions(mx, As).
?- countries(All). % sorted by ISO code
country/2 fails for an unknown code. Codes and regions are case-insensitive and may be atoms or strings.
Records are dicts tagged country, contribution and assumption. Text is a
string, booleans are the atoms true and false, dates are date(Y,M,D) and an
empty optional value is the atom null. Field names follow the CSV columns
(country/2 renames the column "country" to name).
The pack is a lookup library: it returns the figures as exported and computes nothing. Countries flagged total_declared_floor publish an "at least" figure, not a total: read their employer_cost_pct as "at least". Under total_declared_ceiling the modelled contribution base is the highest the law allows and lines with in_total false come on top. A contribution's rate applies to its base times base_factor (1 unless the law builds the base from more than the salary, as Mexico's integrated base does).
For a cost at another salary, use the EOR cost calculator, https://eorscope.com/eor-cost-calculator/, which runs the full computation. How each figure is sourced and checked is set out in the methodology, https://eorscope.com/methodology/. Every country has its own employer of record page, https://eorscope.com/employer-of-record/, with the contribution lines and their official sources.
Cost comparison, not legal or tax advice.
swipl --on-error=status -g run_tests -t halt test/test_eorscope_employer_costs.pl
The tests check the sha256 of the embedded files, the CSV reader, and the same counts and invariants as the other EOR Scope packages (76 countries, 544 lines, 108 assumptions, 13 floor countries). Tested with SWI-Prolog 10.0.2.
Copy country_summary.csv, country_contributions.csv, country_assumptions.csv and LICENSE of a dataset export (https://eorscope.com/data/) into data/, update the sha256 values in the test, then run the tests. The files are read when the library is compiled. data/ is marked -text in .gitattributes so that Git keeps the files byte for byte.
Code: MIT, see LICENSE.
Data (data/): CC BY 4.0, see data/LICENSE. Attribution: EOR Scope, published by Tresor Kaya EI (Les Creavores), France, https://eorscope.com/methodology/.
Pack contains 10 files holding a total of 653K bytes.