Skip to main content

Run the microsimulation model EUROMOD. The latest model and software versions of EUROMOD are available at https://euromod-web.jrc.ec.europa.eu/download-euromod .

Project description

Euromod Connector

python Static Badge Documentation Status

What is Euromod?

The Euromod Connector for Python is built to facilitate and simplify the usage of the EUROMOD microsimulation model for research and analysis purposes.

EUROMOD is a tax-benefit microsimulation model for the European Union that enables researchers and policy analysts to calculate, in a comparable manner, the effects of taxes and benefits on household incomes and work incentives for the population of each country and for the EU as a whole. It is a static microsimulation model that applies user-defined tax and benefit policy rules to harmonised microdata on individuals and households, calculates the effects of these rules on household income.

Installation

Install via PyPi using pip:

$ pip install euromod

Requirements

The Euromod Connector requires two EUROMOD components: 1) the model (coded policy rules) , and 2) the input microdata with the variables that respect the EUROMOD naming conventions. For more information, please, read the sections "Model" and "Input microdata" on the Download Euromod web page.

Run simulation

Importing and loading the model:

In[1]: from euromod import Model
In[2]: mod=Model(r"C:\EUROMOD_RELEASES_I6.0+")

Loading the dataset using pandas:

In[3]: import pandas as pd
In[4]: data = pd.read_csv(r"C:\EUROMOD_RELEASES_I6.0+\Input\sl_demo_v4.txt",sep="\t")

Running a simulation on system 'SL_1996' of the country Simpleland 'SL' (Note: this country model is provided by default with the EUROMOD project):

In[5]: out=mod.countries['SL'].systems['SL_1996'].run(data,'sl_demo_v4')
In[6]: out.outputs[0]
Out[6]:
       idhh  idperson  idmother  ...    ils_dispy  il_taxabley  il_bsa_base
0       1.0     101.0       0.0  ...   807.018500      0.00000    807.01850
1       1.0     102.0       0.0  ...     0.000000      0.00000      0.00000
2       1.0     103.0     102.0  ...     0.000000      0.00000      0.00000
3       1.0     104.0     102.0  ...   934.294772    149.54786    149.54786
4       2.0     201.0       0.0  ...  1337.268280   1421.58535   1337.26828
    ...       ...       ...  ...          ...          ...          ...
1255  500.0   50003.0   50002.0  ...     0.000000      0.00000      0.00000
1256  500.0   50004.0   50002.0  ...     0.000000      0.00000      0.00000
1257  500.0   50005.0   50002.0  ...     0.000000      0.00000      0.00000
1258  500.0   50006.0       0.0  ...   839.845300      0.00000    839.84530
1259  500.0   50007.0       0.0  ...     0.000000      0.00000      0.00000

[1260 rows x 43 columns]

Checking the policies for country Simpleland 'SL':

In[7]: mod.countries['SL'].policies
Out[7]:
0: Uprate_sl            |    DEF: UPRATING FACTORS 
1: ILsDef_sl            |    DEF: STANDARD INCOME CONCEPTS 
2: ILDef_sl             |    DEF: SPECIFIC INCOME CONCEPTS 
3: TUDef_sl             |    DEF: ASSESSMENT UNITS 
4: yem_sl               |    DEF: Minimum Wage 
5: neg_sl               |    DEF: recode negative self-employment income to zer ... 
6: sic_sl               |    SIC: Social Insurance Contributions 
7: bch_sl               |    BEN: Child Benefit 
8: tin_sl               |    TAX: Income Tax 
9: bsa_sl               |    BEN: Social Assistance 
10: output_std_sl       |    DEF: STANDARD OUTPUT INDIVIDUAL LEVEL 
11: output_std_hh_sl    |    DEF: STANDARD OUTPUT HOUSEHOLD LEVEL 

Checking the policies for country Simpleland 'SL' in system 'SL_1996':

In[8]: mod.countries['SL'].systems['SL_1996'].policies
Out[8]:
0: Uprate_sl             | on        |    DEF: UPRATING FACTORS 
1: ILsDef_sl             | on        |    DEF: STANDARD INCOME CONCEPTS 
2: ILDef_sl              | on        |    DEF: SPECIFIC INCOME CONCEPTS 
3: TUDef_sl              | on        |    DEF: ASSESSMENT UNITS 
4: yem_sl                | on        |    DEF: Minimum Wage 
5: neg_sl                | on        |    DEF: recode negative self-employment income to zer ... 
6: sic_sl                | on        |    SIC: Social Insurance Contributions 
7: bch_sl                | on        |    BEN: Child Benefit 
8: tin_sl                | on        |    TAX: Income Tax 
9: bsa_sl                | on        |    BEN: Social Assistance 
10: output_std_sl        | on        |    DEF: STANDARD OUTPUT INDIVIDUAL LEVEL 
11: output_std_hh_sl     | off       |    DEF: STANDARD OUTPUT HOUSEHOLD LEVEL 

Getting information about a specific policy, e.g. "sic_sl", at a country level:

In[9]: mod.countries['SL'].policies[6]
Out[9]:
------------------------------
Policy
------------------------------
	 ID: '20901CF5-0A2A-4BA8-A18A-7092CD6A182D'
	 comment: 'SIC: Social Insurance Contributions'
	 extensions: 0 elements
	 functions: SchedCalc, SchedCalc, SchedCalc
	 name: 'sic_sl'
	 order: '7'
	 private: 'no'
	 spineOrder: '7'

Getting information about a specific policy, e.g. "sic_sl", at a system level:

In[9]: mod.countries['SL'].systems['SL_1996'].policies[6]
Out[9]:
------------------------------
PolicyInSystem
------------------------------
	 ID: 'F7E5CACE-CECC-4BB6-9841-A936D097548120901CF5-0A2A-4BA8-A18A-7092CD6A182D'
	 comment: 'SIC: Social Insurance Contributions'
	 extensions: 0 elements
	 functions: SchedCalc, SchedCalc, SchedCalc
	 name: 'sic_sl'
	 order: '7'
	 polID: '20901CF5-0A2A-4BA8-A18A-7092CD6A182D'
	 private: 'no'
	 spineOrder: '7'
	 switch: 'on'
	 sysID: 'F7E5CACE-CECC-4BB6-9841-A936D0975481'

License

© Copyright 2024 European Commission. EUROMOD is licensed under the EUPL, Version 1.2. See the documentation for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

euromod-0.3.1-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3Windows x86-64

euromod-0.3.1-py3-none-manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file euromod-0.3.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: euromod-0.3.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for euromod-0.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b2c8296c5e696aa232e48d830b0f0f336aecd890100bb7279466b43d0dd0fa4e
MD5 2f71eb03378fa0322b3af0dd913aca09
BLAKE2b-256 81067a5f6cce41a3ed1c11e764b83818bc509c3275999c2d81812eda6b411eec

See more details on using hashes here.

File details

Details for the file euromod-0.3.1-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for euromod-0.3.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd05267e87405e75a384fd0ef6aa66c54f6e9cbd7ee8520a423d4216f4442906
MD5 11f0167927bcfacbc40933ba700790a0
BLAKE2b-256 4f5ab0aaff4c5d7c4ddabb3afc311b7a5e8138b41fca70667b41cef0220f8f9e

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