Python API in the browser

Some online services offer the opportunity to run Python code online without having to install anything on a local machine.

To run OpenFisca directly in the browser for a simulation or to evaluate the impact of a reform, the following services could be useful: Gitpod, repl.it, python anywhere and Jupyterlab.

There is a lot of variance between the above services so rather than offer specific instructions, the following is the type of approach that will be required.

Instructions

  1. Start by installing the package on the online service e.g. OpenFisca-Country-Template.

  2. Write the code the use case requires. The following is an example of a python code snippet to run against the Python API:

    from openfisca_country_template import CountryTaxBenefitSystem
    
    tax_benefit_system = CountryTaxBenefitSystem()
    parameters = tax_benefit_system.parameters
    
    print(parameters)
    
  3. Run the code; check the results.