OpenFisca, a versatile microsimulation free software, has recently deprecated its Web-API module. In this article, we’ll explore the reasons behind the deprecation and provide detailed steps for migrating to the new OpenFisca Core module.
The aim of the OpenFisca Web-API module was to provide users with OpenFisca information and computations through a web interface without the need for local installation. However, after a few years of existence, it became apparent that maintaining separate versioning for the API and Core module was difficult. Additionally, user feedback highlighted the need for improved API endpoints to enhance user experience.
As a result, the OpenFisca team made the decision to deprecate the Web-API module and integrate its functionality into the OpenFisca Core module. This integration ensures better compatibility and easier maintenance moving forward.
To migrate to the new OpenFisca Core module, follow these steps:
- Install Python 2 on your machine if it is not already installed.
- Clone the new OpenFisca-Core repository.
- Ensure you have the latest version of Pip installed.
- Create a new virtual environment using a tool like Pew.
- Install OpenFisca-Web-API and OpenFisca-France in your virtual environment.
- Run the HTTP server to check if the migration was successful.
The code architecture of the new OpenFisca Core module follows a similar structure to the deprecated Web-API module. Each API endpoint has its own controller responsible for handling HTTP requests and returning results in JSON format. The configuration of the application is stored in configuration files, specific to the country, and validated when the application starts.
To ensure a smooth transition, it is recommended to run the unit tests provided with the OpenFisca-Web-API repository. These tests will validate the functionality and identify any potential issues during the migration process.
Examples of API usage can be found in the examples
directory of the OpenFisca-Web-API repository, allowing you to familiarize yourself with the new module.
For production deployment, the OpenFisca Web API provides a production-config
directory with configuration files specifically tailored for production environments.
As an optional feature, the OpenFisca Web API also offers a tracker for measuring API usage. To install and configure the tracker, follow the instructions provided in the repository.
In conclusion, the deprecation of the OpenFisca Web-API module marks an important milestone in the evolution of the OpenFisca project. By migrating to the new OpenFisca Core module, users can benefit from enhanced compatibility and improved API endpoints. Follow the migration steps outlined in this article to seamlessly transition to the new module and continue utilizing the power of OpenFisca’s microsimulation capabilities.
Please feel free to ask any questions you have regarding the deprecation and migration process.
References:
– OpenFisca Web-API Repository: https://github.com/openfisca/openfisca-web-api
– OpenFisca Core Repository: https://github.com/openfisca/openfisca-core
License:
– OpenFisca is released under the GNU Affero General Public License v3.0
Leave a Reply