Skip to main content

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.

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.2-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: euromod-0.3.2-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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 854fcd1e1836731b77a6d0fa1b84e266709aa6cbaa9f56c1e8b1ac31cb7c4321
MD5 0ee578f51249b05834978c689687a475
BLAKE2b-256 29c0a9d3cdf1da78f1f798187342994b5deaa80963c6a724097248fe583aed69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for euromod-0.3.2-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 232b9dd35e582c444b9a1418e4f52bd042c7ee5bb0ed1406e688bbd6ac8880a4
MD5 8e689e63c37fe7279c7e1dadca17c216
BLAKE2b-256 2bb3a3431e22c8b64b61eb9ec830667d4952afeaa11af074bdf4e9001e05fc96

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 Sentry Error logging StatusPage Status page