SlideShare a Scribd company logo
Opening up the French
tax software
http://www.openfisca.fr/
https://framagit.org/openfisca
https://github.com/openfisca
@OpenFisca
Michel Blancard
michel.blancard@data.gouv.fr
PyData – June 14, 2016
I - What is OpenFisca?
Legislation
It's growing!
In French (that most French
people don't understand),
not in python!
Notices
Bulletin Officiel des Finances
Publiques-Impôts (BOFiP)
Décrets
How to compute the French tax and benefits?
It's complex!
4
How to compute the French tax and benefits?
It's complex, because the reality is complex.
Individuals
Housing
Family
Taxation
How to compute the French tax and benefits?
OpenFisca aims to :
●
cover both tax and benefits policies
●
be efficient
●
one family simulation
●
simulation on the whole country
●
be understandable
●
be open source
What is OpenFisca?
OpenFisca is used for :
●
improving readability
to the public
●
designing reforms
●
simulating one's
situation
●
understanding the tax
and social system
mes-aides.gouv.fr
Why compute the French tax and benefits?
OpenFisca is used for :
●
improving readability
to the public
●
designing reforms
●
simulating one's
situation
●
understanding the tax
and social system
How to compute the French taxes ?
tax difference
between/after marriage
OpenFisca is used for :
●
improving readability
to the public
●
designing reforms
●
simulating one's
situation
●
understanding the tax
and social system
How to compute the French taxes ?
personal simulation
ui.openfisca.fr
OpenFisca is used for :
●
improving readability
to the public
●
designing reforms
●
simulating one's
situation
●
understanding the
tax and social system
How to compute the French taxes ?
tax percentage as a
function of income
The history of OpenFisca
2011 2014 2016
2 economists
python scripts
with QT frontend
2 developers
join the project
tax calculator of the
tax administration
released
increasing
demand for an
open simulator
OpenFisca
reaches the sky
and beyond...
(see later)
France Stratégie
France Stratégie
IPP
Etalab
II – The French tax
calculator
●
direct demand (aug 2014)
●
6 months later : seisine of the CADA
●
2 months later : positive notice from the CADA
●
2 months later : beginning of judicial proceedings
●
10 months later : release of the source code !
●
10 months later + ε : the court issues a positive decision
The quest for the source code
(want to speed up the process ? → ouvre-boite.org)
●
April 1-2, 2016 at the Mozilla Fundation
●
presence of 3 Ministers
●
developers, civil servants, economists,
citizens... all sitting at the same table !
A hackathon to celebrate :
CodeImpôt
Preparation by Etalab and DGFiP :
●
understand the Domain Specific
Language (DSL) : M
●
parse using Clean PEG (Igor
Dejanović's Arpeggio)
●
simplify the Abstract Syntax Tree
(AST)
→ Direct Acyclic Graph of trees
Preparation
regle 10214:
application : iliad,batch ;
CSGAC = max(0,CSGC ­ CICSG);
CSNET = max(0,(CSGC + PCSG ­ 
CICSG ­ CSGIM)) ;
RDSAC = max(0,RDSC ­ CIRDS);
RDNET = max(0,(RDSC + PRDS ­ 
CIRDS ­ CRDSIM));
PRSNET = max(0,(PRSC + PPRS ­ 
CIPRS ­ PRSPROV))  ;
CVNAC  =  CVNSALC;
CVNNET  =  max(0,(CVNSALC + PCVN 
­ COD8YT));
REGVNET  = BREGV + PREGV ;
CDISAC = CDISC ;
CDISNET = max(0,(CDISC + PCDIS ­ 
CDISPROV))  ;
CGLOAAC = CGLOA ;
CGLOANET = max(0,(CGLOA + PGLOA­
COD8YL ))  ;
Preparation by Etalab and DGFiP :
●
understand the Domain Specific
Language (DSL) : M
●
parse using Clean PEG (Igor
Dejanović's Arpeggio)
●
simplify the Abstract Syntax Tree
(AST)
→ Direct Acyclic Graph of trees
Preparation
comment = r'#.*'
symbol = r'w+'
symbol_enumeration = symbol 
("," symbol)*
float = r'd+.d+'
integer = r'd+'
string = '"' r'[^"]*' '"'
interval = symbol ".." symbol
brackets = "[" symbol "]"
...
Preparation by Etalab and DGFiP :
●
understand the Domain Specific
Language (DSL) : M
●
parse using Clean PEG (Igor
Dejanović's Arpeggio)
●
simplify the Abstract Syntax Tree
(AST)
→ Direct Acyclic Graph of trees
Preparation
Python object / JSON
●
Directed Acyclic Graph (DAG)
traversal (400ms)
●
Arithmetic computations at each
node (0.4ms in total for a single
simulation)
During the hackathon
Efficient computation
vs
400ms + 0.4ms = 400.4ms
for 1 simulation
400ms + 10.000x0.4ms = 4.4s
for 10.000 simulation
Long live Numpy and vectorized computations !
During the hackathon
Visualise
During the hackathon
Simplify the graph for common fiscal situations
During the hackathon
Transpile to other languages
var functionsMapping = {
    '+':function sumTab(tabValeurs){
         return tabValeurs.reduce(function(a,b){
            return a+b;
        });
    },
    '*':function mulTab(tabValeurs){
        return tabValeurs.reduce(function(a,b){
            return a*b;
        });
    },
    . . .
Step 1 : Define an implementation of the operations
During the hackathon
Transpile to other languages
function computeFormula(node, values){
    if(node.nodetype ==='symbol'){
        var value = values[node.name];
        if(typeof(value)==='undefined'){
            value = 0;
        };
        return value
    }else if(node.nodetype ==='float'){
        return node.value;
    }else if(node.nodetype==='call'){
        var name = node.name;
        var func = functionsMapping[name];
        var args = [];
        for(i in node.args){
            args.push(computeFormula(node.args[i],values));
        }
        return func(args);
    }
}
Step 2 : Code a DAG traversal
III – From code to data
II – The French tax
calculator
Tax rules vs implementation
Rule of least power
different concerns
storage
versioning
editing
speed
simplicity
(technologies
evolve fast)
Python Code
Quality Authority
Parsing the current code
Baron
Redbaron
Astroid Custom python
python → julia
2to3
The future
Tax rules
written in
DSL(s)
Unique internal
graph
representation
Implementation(s)
The glue ? Python ? A functional language ?
Take-away message
Language choice is not definitive !
(if you start with python)
Thank you !
http://www.openfisca.fr/
https://framagit.org/openfisca
https://github.com/openfisca
@OpenFisca
Michel Blancard
michel.blancard@data.gouv.fr
PyData – June 14, 2016
We are hiring !

More Related Content

Similar to Opening up the French tax software

French building of SDI : a bottom-up or a top-down process?
French building of SDI : a bottom-up or a top-down process?French building of SDI : a bottom-up or a top-down process?
French building of SDI : a bottom-up or a top-down process?
Marc Leobet
 
Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...
Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...
Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...
OECD Governance
 
Janus conf'19: janus client side
Janus conf'19:  janus client sideJanus conf'19:  janus client side
Janus conf'19: janus client side
Alexandre Gouaillard
 
AdmiSource - french e-government forge
AdmiSource - french e-government forgeAdmiSource - french e-government forge
AdmiSource - french e-government forge
Alexis Monville
 
The use of FLOSS in Governments
The use of FLOSS in GovernmentsThe use of FLOSS in Governments
The use of FLOSS in Governments
Nico Elema
 
The reuse of open data: an opportunity for Spain
The reuse of open data: an opportunity for SpainThe reuse of open data: an opportunity for Spain
The reuse of open data: an opportunity for Spain
Alberto Abella
 
Conférence INSPIRE de Rotterdam (2009) CNIG
Conférence INSPIRE de Rotterdam (2009) CNIGConférence INSPIRE de Rotterdam (2009) CNIG
Conférence INSPIRE de Rotterdam (2009) CNIG
Marc Leobet
 
José Manuel Leceta-La nueva revolución de la producción: la transformación di...
José Manuel Leceta-La nueva revolución de la producción: la transformación di...José Manuel Leceta-La nueva revolución de la producción: la transformación di...
José Manuel Leceta-La nueva revolución de la producción: la transformación di...
Fundación Ramón Areces
 
Month of innovation 13 australian gov ct uinfoshare
Month of innovation 13 australian gov ct uinfoshare Month of innovation 13 australian gov ct uinfoshare
Month of innovation 13 australian gov ct uinfoshare
christophe tallec
 
Local Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell ExtensionLocal Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell Extension
Sammy Fung
 
Powering digital city tools with open source, OW2con'18, June 7-8, 2018, Paris
Powering digital city tools with open source, OW2con'18, June 7-8, 2018, ParisPowering digital city tools with open source, OW2con'18, June 7-8, 2018, Paris
Powering digital city tools with open source, OW2con'18, June 7-8, 2018, Paris
OW2
 
Cv jaime santos_20210105_1700english
Cv jaime santos_20210105_1700englishCv jaime santos_20210105_1700english
Cv jaime santos_20210105_1700english
Jaime Santos Gonzalez
 
European Open Source Anchors in the Supply Chain
European Open Source Anchors in the Supply ChainEuropean Open Source Anchors in the Supply Chain
European Open Source Anchors in the Supply Chain
OW2
 
GeospatialWorlForum_Genève_090514
GeospatialWorlForum_Genève_090514GeospatialWorlForum_Genève_090514
GeospatialWorlForum_Genève_090514
Marc Leobet
 
Introduction to Caixa Magica Software
Introduction to Caixa Magica SoftwareIntroduction to Caixa Magica Software
Introduction to Caixa Magica Software
johngt
 
OSMC 2018 | Distributed Tracing FAQ by Gianluca Arbezzano
OSMC 2018 | Distributed Tracing FAQ by Gianluca ArbezzanoOSMC 2018 | Distributed Tracing FAQ by Gianluca Arbezzano
OSMC 2018 | Distributed Tracing FAQ by Gianluca Arbezzano
NETWAYS
 
FreeGIS.net, INSPIRE, Open Source Software and OGC standards
FreeGIS.net, INSPIRE, Open Source Software and OGC standardsFreeGIS.net, INSPIRE, Open Source Software and OGC standards
FreeGIS.net, INSPIRE, Open Source Software and OGC standards
Arnulf Christl
 
Case Studies: Burkina Open Data Initiative/Malick Tapsoba
Case Studies: Burkina Open Data Initiative/Malick TapsobaCase Studies: Burkina Open Data Initiative/Malick Tapsoba
Case Studies: Burkina Open Data Initiative/Malick Tapsoba
Academy of Science of South Africa (ASSAf)
 
Ecosystem WG
Ecosystem WGEcosystem WG
Ecosystem WG
TinaBregovi
 
Update September - December 2017
Update September - December 2017Update September - December 2017
Update September - December 2017
extax
 

Similar to Opening up the French tax software (20)

French building of SDI : a bottom-up or a top-down process?
French building of SDI : a bottom-up or a top-down process?French building of SDI : a bottom-up or a top-down process?
French building of SDI : a bottom-up or a top-down process?
 
Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...
Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...
Presentation by Christian Quest on Openstreetmap made at the OECD Conference ...
 
Janus conf'19: janus client side
Janus conf'19:  janus client sideJanus conf'19:  janus client side
Janus conf'19: janus client side
 
AdmiSource - french e-government forge
AdmiSource - french e-government forgeAdmiSource - french e-government forge
AdmiSource - french e-government forge
 
The use of FLOSS in Governments
The use of FLOSS in GovernmentsThe use of FLOSS in Governments
The use of FLOSS in Governments
 
The reuse of open data: an opportunity for Spain
The reuse of open data: an opportunity for SpainThe reuse of open data: an opportunity for Spain
The reuse of open data: an opportunity for Spain
 
Conférence INSPIRE de Rotterdam (2009) CNIG
Conférence INSPIRE de Rotterdam (2009) CNIGConférence INSPIRE de Rotterdam (2009) CNIG
Conférence INSPIRE de Rotterdam (2009) CNIG
 
José Manuel Leceta-La nueva revolución de la producción: la transformación di...
José Manuel Leceta-La nueva revolución de la producción: la transformación di...José Manuel Leceta-La nueva revolución de la producción: la transformación di...
José Manuel Leceta-La nueva revolución de la producción: la transformación di...
 
Month of innovation 13 australian gov ct uinfoshare
Month of innovation 13 australian gov ct uinfoshare Month of innovation 13 australian gov ct uinfoshare
Month of innovation 13 australian gov ct uinfoshare
 
Local Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell ExtensionLocal Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell Extension
 
Powering digital city tools with open source, OW2con'18, June 7-8, 2018, Paris
Powering digital city tools with open source, OW2con'18, June 7-8, 2018, ParisPowering digital city tools with open source, OW2con'18, June 7-8, 2018, Paris
Powering digital city tools with open source, OW2con'18, June 7-8, 2018, Paris
 
Cv jaime santos_20210105_1700english
Cv jaime santos_20210105_1700englishCv jaime santos_20210105_1700english
Cv jaime santos_20210105_1700english
 
European Open Source Anchors in the Supply Chain
European Open Source Anchors in the Supply ChainEuropean Open Source Anchors in the Supply Chain
European Open Source Anchors in the Supply Chain
 
GeospatialWorlForum_Genève_090514
GeospatialWorlForum_Genève_090514GeospatialWorlForum_Genève_090514
GeospatialWorlForum_Genève_090514
 
Introduction to Caixa Magica Software
Introduction to Caixa Magica SoftwareIntroduction to Caixa Magica Software
Introduction to Caixa Magica Software
 
OSMC 2018 | Distributed Tracing FAQ by Gianluca Arbezzano
OSMC 2018 | Distributed Tracing FAQ by Gianluca ArbezzanoOSMC 2018 | Distributed Tracing FAQ by Gianluca Arbezzano
OSMC 2018 | Distributed Tracing FAQ by Gianluca Arbezzano
 
FreeGIS.net, INSPIRE, Open Source Software and OGC standards
FreeGIS.net, INSPIRE, Open Source Software and OGC standardsFreeGIS.net, INSPIRE, Open Source Software and OGC standards
FreeGIS.net, INSPIRE, Open Source Software and OGC standards
 
Case Studies: Burkina Open Data Initiative/Malick Tapsoba
Case Studies: Burkina Open Data Initiative/Malick TapsobaCase Studies: Burkina Open Data Initiative/Malick Tapsoba
Case Studies: Burkina Open Data Initiative/Malick Tapsoba
 
Ecosystem WG
Ecosystem WGEcosystem WG
Ecosystem WG
 
Update September - December 2017
Update September - December 2017Update September - December 2017
Update September - December 2017
 

More from Etalab

EIG Promo 2 - Présentation du défi dataESR
EIG Promo 2 - Présentation du défi dataESR EIG Promo 2 - Présentation du défi dataESR
EIG Promo 2 - Présentation du défi dataESR
Etalab
 
EIG Promo 2 - Présentation du défi CoachÉlève, AssistProf
EIG Promo 2 - Présentation du défi CoachÉlève, AssistProfEIG Promo 2 - Présentation du défi CoachÉlève, AssistProf
EIG Promo 2 - Présentation du défi CoachÉlève, AssistProf
Etalab
 
EIG Promo 2 - Présentation du défi Brigade Numérique
EIG Promo 2 - Présentation du défi Brigade NumériqueEIG Promo 2 - Présentation du défi Brigade Numérique
EIG Promo 2 - Présentation du défi Brigade Numérique
Etalab
 
EIG Promo 2 - Présentation du défi Archifiltre
EIG Promo 2 - Présentation du défi ArchifiltreEIG Promo 2 - Présentation du défi Archifiltre
EIG Promo 2 - Présentation du défi Archifiltre
Etalab
 
EIG Promo 2 - Présentation du défi Hopkins
EIG Promo 2 - Présentation du défi HopkinsEIG Promo 2 - Présentation du défi Hopkins
EIG Promo 2 - Présentation du défi Hopkins
Etalab
 
EIG Promo 2 - Présentation du défi Signaux Faibles
EIG Promo 2 - Présentation du défi Signaux FaiblesEIG Promo 2 - Présentation du défi Signaux Faibles
EIG Promo 2 - Présentation du défi Signaux Faibles
Etalab
 
EIG Promo 2 - Présentation du défi baliseNAV
EIG Promo 2 - Présentation du défi baliseNAVEIG Promo 2 - Présentation du défi baliseNAV
EIG Promo 2 - Présentation du défi baliseNAV
Etalab
 
EIG Promo 2 - Présentation du défi Prévisecours
EIG Promo 2 - Présentation du défi PrévisecoursEIG Promo 2 - Présentation du défi Prévisecours
EIG Promo 2 - Présentation du défi Prévisecours
Etalab
 
EIG Promo 2 - Présentation du défi Gobelins
EIG Promo 2 - Présentation du défi GobelinsEIG Promo 2 - Présentation du défi Gobelins
EIG Promo 2 - Présentation du défi Gobelins
Etalab
 
Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)
Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)
Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)
Etalab
 
Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)
Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)
Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)
Etalab
 
Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)
Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)
Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)
Etalab
 
OGP Summit - Democracy Night - December 2016
OGP Summit - Democracy Night - December 2016OGP Summit - Democracy Night - December 2016
OGP Summit - Democracy Night - December 2016
Etalab
 
Toward a data driven government
Toward a data driven governmentToward a data driven government
Toward a data driven government
Etalab
 
Atelier "journée de la société civile" - PGO
Atelier "journée de la société civile" - PGO Atelier "journée de la société civile" - PGO
Atelier "journée de la société civile" - PGO
Etalab
 
Préparation du hackathon mondial PGO
Préparation du hackathon mondial PGOPréparation du hackathon mondial PGO
Préparation du hackathon mondial PGO
Etalab
 
Co-construction du programme du Sommet mondial PGO
Co-construction du programme du Sommet mondial PGOCo-construction du programme du Sommet mondial PGO
Co-construction du programme du Sommet mondial PGO
Etalab
 
Cérémonie Dataconnexions 6 - mardi 2 février 2016
Cérémonie Dataconnexions 6 - mardi 2 février 2016Cérémonie Dataconnexions 6 - mardi 2 février 2016
Cérémonie Dataconnexions 6 - mardi 2 février 2016
Etalab
 
20150317 OGP Point d'étape Plan d'Action National
20150317 OGP Point d'étape Plan d'Action National20150317 OGP Point d'étape Plan d'Action National
20150317 OGP Point d'étape Plan d'Action National
Etalab
 
Support Point d'étape Plan d'Action National OGP
Support Point d'étape Plan d'Action National OGPSupport Point d'étape Plan d'Action National OGP
Support Point d'étape Plan d'Action National OGPEtalab
 

More from Etalab (20)

EIG Promo 2 - Présentation du défi dataESR
EIG Promo 2 - Présentation du défi dataESR EIG Promo 2 - Présentation du défi dataESR
EIG Promo 2 - Présentation du défi dataESR
 
EIG Promo 2 - Présentation du défi CoachÉlève, AssistProf
EIG Promo 2 - Présentation du défi CoachÉlève, AssistProfEIG Promo 2 - Présentation du défi CoachÉlève, AssistProf
EIG Promo 2 - Présentation du défi CoachÉlève, AssistProf
 
EIG Promo 2 - Présentation du défi Brigade Numérique
EIG Promo 2 - Présentation du défi Brigade NumériqueEIG Promo 2 - Présentation du défi Brigade Numérique
EIG Promo 2 - Présentation du défi Brigade Numérique
 
EIG Promo 2 - Présentation du défi Archifiltre
EIG Promo 2 - Présentation du défi ArchifiltreEIG Promo 2 - Présentation du défi Archifiltre
EIG Promo 2 - Présentation du défi Archifiltre
 
EIG Promo 2 - Présentation du défi Hopkins
EIG Promo 2 - Présentation du défi HopkinsEIG Promo 2 - Présentation du défi Hopkins
EIG Promo 2 - Présentation du défi Hopkins
 
EIG Promo 2 - Présentation du défi Signaux Faibles
EIG Promo 2 - Présentation du défi Signaux FaiblesEIG Promo 2 - Présentation du défi Signaux Faibles
EIG Promo 2 - Présentation du défi Signaux Faibles
 
EIG Promo 2 - Présentation du défi baliseNAV
EIG Promo 2 - Présentation du défi baliseNAVEIG Promo 2 - Présentation du défi baliseNAV
EIG Promo 2 - Présentation du défi baliseNAV
 
EIG Promo 2 - Présentation du défi Prévisecours
EIG Promo 2 - Présentation du défi PrévisecoursEIG Promo 2 - Présentation du défi Prévisecours
EIG Promo 2 - Présentation du défi Prévisecours
 
EIG Promo 2 - Présentation du défi Gobelins
EIG Promo 2 - Présentation du défi GobelinsEIG Promo 2 - Présentation du défi Gobelins
EIG Promo 2 - Présentation du défi Gobelins
 
Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)
Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)
Journée #OpenAPB - intervention de Bernard Koehret (INP Toulouse)
 
Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)
Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)
Journée #OpenAPB - intervention de Leïla Frouillou (Université Paris 8)
 
Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)
Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)
Journée #OpenAPB - intervention de Julien Grenet (Ecole d'Economie de Paris)
 
OGP Summit - Democracy Night - December 2016
OGP Summit - Democracy Night - December 2016OGP Summit - Democracy Night - December 2016
OGP Summit - Democracy Night - December 2016
 
Toward a data driven government
Toward a data driven governmentToward a data driven government
Toward a data driven government
 
Atelier "journée de la société civile" - PGO
Atelier "journée de la société civile" - PGO Atelier "journée de la société civile" - PGO
Atelier "journée de la société civile" - PGO
 
Préparation du hackathon mondial PGO
Préparation du hackathon mondial PGOPréparation du hackathon mondial PGO
Préparation du hackathon mondial PGO
 
Co-construction du programme du Sommet mondial PGO
Co-construction du programme du Sommet mondial PGOCo-construction du programme du Sommet mondial PGO
Co-construction du programme du Sommet mondial PGO
 
Cérémonie Dataconnexions 6 - mardi 2 février 2016
Cérémonie Dataconnexions 6 - mardi 2 février 2016Cérémonie Dataconnexions 6 - mardi 2 février 2016
Cérémonie Dataconnexions 6 - mardi 2 février 2016
 
20150317 OGP Point d'étape Plan d'Action National
20150317 OGP Point d'étape Plan d'Action National20150317 OGP Point d'étape Plan d'Action National
20150317 OGP Point d'étape Plan d'Action National
 
Support Point d'étape Plan d'Action National OGP
Support Point d'étape Plan d'Action National OGPSupport Point d'étape Plan d'Action National OGP
Support Point d'étape Plan d'Action National OGP
 

Recently uploaded

Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 

Recently uploaded (20)

Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 

Opening up the French tax software

  • 1. Opening up the French tax software http://www.openfisca.fr/ https://framagit.org/openfisca https://github.com/openfisca @OpenFisca Michel Blancard michel.blancard@data.gouv.fr PyData – June 14, 2016
  • 2. I - What is OpenFisca?
  • 3. Legislation It's growing! In French (that most French people don't understand), not in python! Notices Bulletin Officiel des Finances Publiques-Impôts (BOFiP) Décrets How to compute the French tax and benefits?
  • 4. It's complex! 4 How to compute the French tax and benefits?
  • 5. It's complex, because the reality is complex. Individuals Housing Family Taxation How to compute the French tax and benefits?
  • 6. OpenFisca aims to : ● cover both tax and benefits policies ● be efficient ● one family simulation ● simulation on the whole country ● be understandable ● be open source What is OpenFisca?
  • 7. OpenFisca is used for : ● improving readability to the public ● designing reforms ● simulating one's situation ● understanding the tax and social system mes-aides.gouv.fr Why compute the French tax and benefits?
  • 8. OpenFisca is used for : ● improving readability to the public ● designing reforms ● simulating one's situation ● understanding the tax and social system How to compute the French taxes ? tax difference between/after marriage
  • 9. OpenFisca is used for : ● improving readability to the public ● designing reforms ● simulating one's situation ● understanding the tax and social system How to compute the French taxes ? personal simulation ui.openfisca.fr
  • 10. OpenFisca is used for : ● improving readability to the public ● designing reforms ● simulating one's situation ● understanding the tax and social system How to compute the French taxes ? tax percentage as a function of income
  • 11. The history of OpenFisca 2011 2014 2016 2 economists python scripts with QT frontend 2 developers join the project tax calculator of the tax administration released increasing demand for an open simulator OpenFisca reaches the sky and beyond... (see later) France Stratégie France Stratégie IPP Etalab
  • 12. II – The French tax calculator
  • 13. ● direct demand (aug 2014) ● 6 months later : seisine of the CADA ● 2 months later : positive notice from the CADA ● 2 months later : beginning of judicial proceedings ● 10 months later : release of the source code ! ● 10 months later + ε : the court issues a positive decision The quest for the source code (want to speed up the process ? → ouvre-boite.org)
  • 14. ● April 1-2, 2016 at the Mozilla Fundation ● presence of 3 Ministers ● developers, civil servants, economists, citizens... all sitting at the same table ! A hackathon to celebrate : CodeImpôt
  • 15. Preparation by Etalab and DGFiP : ● understand the Domain Specific Language (DSL) : M ● parse using Clean PEG (Igor Dejanović's Arpeggio) ● simplify the Abstract Syntax Tree (AST) → Direct Acyclic Graph of trees Preparation regle 10214: application : iliad,batch ; CSGAC = max(0,CSGC ­ CICSG); CSNET = max(0,(CSGC + PCSG ­  CICSG ­ CSGIM)) ; RDSAC = max(0,RDSC ­ CIRDS); RDNET = max(0,(RDSC + PRDS ­  CIRDS ­ CRDSIM)); PRSNET = max(0,(PRSC + PPRS ­  CIPRS ­ PRSPROV))  ; CVNAC  =  CVNSALC; CVNNET  =  max(0,(CVNSALC + PCVN  ­ COD8YT)); REGVNET  = BREGV + PREGV ; CDISAC = CDISC ; CDISNET = max(0,(CDISC + PCDIS ­  CDISPROV))  ; CGLOAAC = CGLOA ; CGLOANET = max(0,(CGLOA + PGLOA­ COD8YL ))  ;
  • 16. Preparation by Etalab and DGFiP : ● understand the Domain Specific Language (DSL) : M ● parse using Clean PEG (Igor Dejanović's Arpeggio) ● simplify the Abstract Syntax Tree (AST) → Direct Acyclic Graph of trees Preparation comment = r'#.*' symbol = r'w+' symbol_enumeration = symbol  ("," symbol)* float = r'd+.d+' integer = r'd+' string = '"' r'[^"]*' '"' interval = symbol ".." symbol brackets = "[" symbol "]" ...
  • 17. Preparation by Etalab and DGFiP : ● understand the Domain Specific Language (DSL) : M ● parse using Clean PEG (Igor Dejanović's Arpeggio) ● simplify the Abstract Syntax Tree (AST) → Direct Acyclic Graph of trees Preparation Python object / JSON
  • 18. ● Directed Acyclic Graph (DAG) traversal (400ms) ● Arithmetic computations at each node (0.4ms in total for a single simulation) During the hackathon Efficient computation vs 400ms + 0.4ms = 400.4ms for 1 simulation 400ms + 10.000x0.4ms = 4.4s for 10.000 simulation Long live Numpy and vectorized computations !
  • 20. During the hackathon Simplify the graph for common fiscal situations
  • 21. During the hackathon Transpile to other languages var functionsMapping = {     '+':function sumTab(tabValeurs){          return tabValeurs.reduce(function(a,b){             return a+b;         });     },     '*':function mulTab(tabValeurs){         return tabValeurs.reduce(function(a,b){             return a*b;         });     },     . . . Step 1 : Define an implementation of the operations
  • 22. During the hackathon Transpile to other languages function computeFormula(node, values){     if(node.nodetype ==='symbol'){         var value = values[node.name];         if(typeof(value)==='undefined'){             value = 0;         };         return value     }else if(node.nodetype ==='float'){         return node.value;     }else if(node.nodetype==='call'){         var name = node.name;         var func = functionsMapping[name];         var args = [];         for(i in node.args){             args.push(computeFormula(node.args[i],values));         }         return func(args);     } } Step 2 : Code a DAG traversal
  • 23. III – From code to data
  • 24. II – The French tax calculator Tax rules vs implementation Rule of least power different concerns storage versioning editing speed simplicity (technologies evolve fast)
  • 25. Python Code Quality Authority Parsing the current code Baron Redbaron Astroid Custom python python → julia 2to3
  • 26. The future Tax rules written in DSL(s) Unique internal graph representation Implementation(s) The glue ? Python ? A functional language ?
  • 27. Take-away message Language choice is not definitive ! (if you start with python)
  • 28. Thank you ! http://www.openfisca.fr/ https://framagit.org/openfisca https://github.com/openfisca @OpenFisca Michel Blancard michel.blancard@data.gouv.fr PyData – June 14, 2016 We are hiring !