OpenFisca-Core


NameOpenFisca-Core JSON
Version 41.4.3 PyPI version JSON
download
home_pagehttps://github.com/openfisca/openfisca-core
SummaryA versatile microsimulation free software
upload_time2024-03-18 14:27:46
maintainer
docs_urlNone
authorOpenFisca Team
requires_python
licensehttps://www.fsf.org/licensing/licenses/agpl-3.0.html
keywords benefit microsimulation social tax
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenFisca Core

[![PyPi Downloads](https://img.shields.io/pypi/dm/openfisca-core?label=pypi%2Fdownloads&style=for-the-badge)](https://pepy.tech/project/openfisca-core)
[![PyPi Version](https://img.shields.io/pypi/v/openfisca-core.svg?label=pypi%2Fversion&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/openfisca-core?label=conda%2Fdownloads&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/openfisca-core.svg?label=conda%2Fversion&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)

[![Python](https://img.shields.io/pypi/pyversions/openfisca-core.svg?label=python&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
[![Coveralls](https://img.shields.io/coveralls/github/openfisca/openfisca-core/master.svg?label=code%20coverage&style=for-the-badge)](https://coveralls.io/github/openfisca/openfisca-core?branch=master)
[![Contributors](https://img.shields.io/github/contributors/openfisca/openfisca-core.svg?style=for-the-badge)](https://github.com/openfisca/openfisca-core/graphs/contributors)

[![Newsletter](https://img.shields.io/badge/newsletter-subscribe!-informational.svg?style=for-the-badge)](mailto:contact%40openfisca.org?subject=Subscribe%20to%20your%20newsletter%20%7C%20S'inscrire%20%C3%A0%20votre%20newsletter&body=%5BEnglish%20version%20below%5D%0A%0ABonjour%2C%0A%0AVotre%C2%A0pr%C3%A9sence%C2%A0ici%C2%A0nous%C2%A0ravit%C2%A0!%20%F0%9F%98%83%0A%0AEnvoyez-nous%20cet%20email%20pour%20que%20l'on%20puisse%20vous%20inscrire%20%C3%A0%20la%20newsletter.%20%0A%0AAh%C2%A0!%20Et%20si%20vous%20pouviez%20remplir%20ce%20petit%20questionnaire%2C%20%C3%A7a%20serait%20encore%20mieux%C2%A0!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2F45M0VR1TYKD1RGzX2%0A%0AAmiti%C3%A9%2C%0AL%E2%80%99%C3%A9quipe%20OpenFisca%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20ENGLISH%20VERSION%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0AHi%2C%20%0A%0AWe're%20glad%20to%20see%20you%20here!%20%F0%9F%98%83%0A%0APlease%20send%20us%20this%20email%2C%20so%20we%20can%20subscribe%20you%20to%20the%20newsletter.%0A%0AAlso%2C%20if%20you%20can%20fill%20out%20this%20short%20survey%2C%20even%20better!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2FsOg8K1abhhm441LG2%0A%0ACheers%2C%0AThe%20OpenFisca%20Team)
[![Twitter](https://img.shields.io/badge/twitter-follow%20us!-9cf.svg?style=for-the-badge)](https://twitter.com/intent/follow?screen_name=openfisca)
[![Slack](https://img.shields.io/badge/slack-join%20us!-blueviolet.svg?style=for-the-badge)](mailto:contact%40openfisca.org?subject=Join%20you%20on%20Slack%20%7C%20Nous%20rejoindre%20sur%20Slack&body=%5BEnglish%20version%20below%5D%0A%0ABonjour%2C%0A%0AVotre%C2%A0pr%C3%A9sence%C2%A0ici%C2%A0nous%C2%A0ravit%C2%A0!%20%F0%9F%98%83%0A%0ARacontez-nous%20un%20peu%20de%20vous%2C%20et%20du%20pourquoi%20de%20votre%20int%C3%A9r%C3%AAt%20de%20rejoindre%20la%20communaut%C3%A9%20OpenFisca%20sur%20Slack.%0A%0AAh%C2%A0!%20Et%20si%20vous%20pouviez%20remplir%20ce%20petit%20questionnaire%2C%20%C3%A7a%20serait%20encore%20mieux%C2%A0!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2F45M0VR1TYKD1RGzX2%0A%0AN%E2%80%99oubliez%20pas%20de%20nous%20envoyer%20cet%20email%C2%A0!%20Sinon%2C%20on%20ne%20pourra%20pas%20vous%20contacter%20ni%20vous%20inviter%20sur%20Slack.%0A%0AAmiti%C3%A9%2C%0AL%E2%80%99%C3%A9quipe%20OpenFisca%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20ENGLISH%20VERSION%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0AHi%2C%20%0A%0AWe're%20glad%20to%20see%20you%20here!%20%F0%9F%98%83%0A%0APlease%20tell%20us%20a%20bit%20about%20you%20and%20why%20you%20want%20to%20join%20the%20OpenFisca%20community%20on%20Slack.%0A%0AAlso%2C%20if%20you%20can%20fill%20out%20this%20short%20survey%2C%20even%20better!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2FsOg8K1abhhm441LG2.%0A%0ADon't%20forget%20to%20send%20us%20this%20email!%20Otherwise%20we%20won't%20be%20able%20to%20contact%20you%20back%2C%20nor%20invite%20you%20on%20Slack.%0A%0ACheers%2C%0AThe%20OpenFisca%20Team)

[OpenFisca](https://openfisca.org/doc/) is a versatile microsimulation free software. Check the [online documentation](https://openfisca.org/doc/) for more details.

This package contains the core features of OpenFisca, which are meant to be used by country packages such as [OpenFisca-France](https://github.com/openfisca/openfisca-france). Bootstrapping your own country package should not take more than 5 minutes: check our [country package template](https://github.com/openfisca/country-template).

## Environment

OpenFisca runs on Python 3.7. More recent versions should work but are not tested.

OpenFisca also relies strongly on NumPy. The last four minor versions should work, but only the latest/stable is tested.

## Installation

If you're developing your own country package, you don't need to explicitly install OpenFisca-Core. It just needs to appear [in your package dependencies](https://github.com/openfisca/openfisca-france/blob/100.0.0/setup.py#L60).
If you want to contribute to OpenFisca-Core itself, welcome!
To install it locally you can use one of these two options:
* [conda](https://docs.conda.io/en/latest/) package manager that we recommend for Windows operating system users,
* or standard Python [pip](https://packaging.python.org/en/latest/key_projects/#pip) package manager.

### Installing `openfisca-core` with `pip`

This installation requires [Python](https://www.python.org/downloads/) 3.7+ and [GIT](https://git-scm.com) installations.

To install `openfisca-core` locally in development mode run the following commands in a shell terminal:

```bash
git clone https://github.com/openfisca/openfisca-core.git
cd openfisca-core
python3 -m venv .venv
source .venv/bin/activate
make install-deps install-edit
```

### Installing `openfisca-core` with `conda`

Since `openfisca-core` version [35.7.7](https://anaconda.org/conda-forge/openfisca-core), you could use `conda` to install OpenFisca-Core.

Conda is the easiest way to use OpenFisca under Windows as by installing Anaconda you will get:
- Python
- The package manager [Anaconda.org](https://docs.anaconda.com/anacondaorg/user-guide/)
- A virtual environment manager : [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
- A GUI [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/index.html) if you choose to install the full [Anaconda](https://www.anaconda.com/products/individual)

If you are familiar with the command line you could use [Miniconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html), which needs very much less disk space than Anaconda.

After installing conda, run these commands in an `Anaconda Powershell Prompt`:
- `conda create --name openfisca python=3.7` to create an `openfisca` environment.
- `conda activate openfisca` to use your new environment.

Then, choose one of the following options according to your use case:
- `conda install -c conda-forge openfisca-core` for default dependencies,
- or `conda install -c conda-forge openfisca-core-api` if you want the Web API part,
- or `conda install -c conda-forge -c openfisca openfisca-core-dev` if you want all the dependencies needed to contribute to the project.

For information on how we publish to conda-forge, see [openfisca-core-feedstock](https://github.com/openfisca/openfisca-core-feedstock/blob/master/recipe/README.md).

## Testing

Install the test dependencies:

```
make install-deps install-edit install-test
```

> For integration testing purposes, `openfisca-core` relies on
> [country-template](https://github.com/openfisca/country-template.git) and
> [extension-template](https://github.com/openfisca/extension-template.git).
> Because these packages rely at the same time on `openfisca-core`, they need
> to be installed separately.

To run the entire test suite:

```sh
make test
```

To run all the tests defined on a test file:

```sh
pytest tests/core/test_parameters.py
```

To run a single test:

```sh
pytest tests/core/test_parameters.py -k test_parameter_for_period
```

## Types

This repository relies on MyPy for optional dynamic & static type checking.

As NumPy introduced the `typing` module in 1.20.0, to ensure type hints do not break the code at runtime, we run the checker against the last four minor NumPy versions.

Type checking is already run with `make test`. To run the type checker alone:

```sh
make check-types
```

## Style

This repository adheres to a [certain coding style](STYLEGUIDE.md), and we invite you to follow it for your contributions to be integrated promptly.

Style checking is already run with `make test`. To run the style checker alone:

```sh
make check-style
```

To automatically style-format your code changes:

```sh
make format-style
```

To automatically style-format your code changes each time you commit:

```sh
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

tee -a .git/hooks/pre-commit << END
#!/bin/sh
#
# Automatically format your code before committing.
exec make format-style
END
```

## Documentation

OpenFisca’s toolchain checks whether documentation builds correctly and updates it automatically with each contribution to this repository.

In the meantime, please take a look at our [contributing guidelines](CONTRIBUTING.md) for some general tips on how to document your contributions, and at our official documentation's [repository](https://github.com/openfisca/openfisca-doc/blob/master/README.md) to in case you want to know how to build it by yourself —and improve it!

## Serving the API

OpenFisca-Core provides a Web-API. It is by default served on the `5000` port.

To run it with the mock country package `openfisca_country_template` and another port value such as `2000`, run:

```sh
openfisca serve --country-package openfisca_country_template --port 2000
```

To read more about the `openfisca serve` command, check out its [documentation](https://openfisca.org/doc/openfisca-python-api/openfisca_serve.html).

By default, the Web API uses 3 workers to avoid [this issue](http://stackoverflow.com/questions/11150343/slow-requests-on-local-flask-server). Without it, AJAX requests from Chrome sometimes take more than 20s to process. You can change the number of workers by specifying a `--workers k` option.

You can test that the API is running by executing the command:

```sh
curl http://localhost:2000/parameters
```
For more information about endpoints and input formatting, see the [official documentation](https://openfisca.org/doc/openfisca-web-api).

### Tracker

The OpenFisca Web API comes with an [optional tracker](https://github.com/openfisca/tracker) which allows you to measure the usage of the API.

#### Tracker installation

The tracker is not installed by default. To install it, run:

```sh
pip install openfisca_core[tracker] --use-deprecated=legacy-resolver # Or `pip install --editable ".[tracker]"` for an editable installation
```


#### Tracker configuration

The tracker is activated when these two options are set:

* `--tracker-url`: An URL ending with `piwik.php`. It defines the Piwik instance that will receive the tracking information. To use the main OpenFisca Piwik instance, use `https://stats.data.gouv.fr/piwik.php`.
* `--tracker-idsite`: An integer. It defines the identifier of the tracked site on your Piwik instance. To use the main OpenFisca piwik instance, use `4`.
* `--tracker-token`: A string. It defines the Piwik API Authentification token to differentiate API calls based on the user IP. Otherwise, all API calls will seem to come from your server. The Piwik API Authentification token can be found in your Piwik interface when you are logged in.

For instance, to run the Web API with the mock country package `openfisca_country_template` and the tracker activated, run:

```sh
openfisca serve --country-package openfisca_country_template --port 5000 --tracker-url https://stats.data.gouv.fr/piwik.php --tracker-idsite 4 --tracker-token $TRACKER_TOKEN
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openfisca/openfisca-core",
    "name": "OpenFisca-Core",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "benefit microsimulation social tax",
    "author": "OpenFisca Team",
    "author_email": "contact@openfisca.org",
    "download_url": "https://files.pythonhosted.org/packages/f5/77/e18773b130f44b57e38eeb4d4bb2d0f8d6a6644a226f37340243b7a2083a/OpenFisca-Core-41.4.3.tar.gz",
    "platform": null,
    "description": "# OpenFisca Core\n\n[![PyPi Downloads](https://img.shields.io/pypi/dm/openfisca-core?label=pypi%2Fdownloads&style=for-the-badge)](https://pepy.tech/project/openfisca-core)\n[![PyPi Version](https://img.shields.io/pypi/v/openfisca-core.svg?label=pypi%2Fversion&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)\n[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/openfisca-core?label=conda%2Fdownloads&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/openfisca-core.svg?label=conda%2Fversion&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)\n\n[![Python](https://img.shields.io/pypi/pyversions/openfisca-core.svg?label=python&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)\n[![Coveralls](https://img.shields.io/coveralls/github/openfisca/openfisca-core/master.svg?label=code%20coverage&style=for-the-badge)](https://coveralls.io/github/openfisca/openfisca-core?branch=master)\n[![Contributors](https://img.shields.io/github/contributors/openfisca/openfisca-core.svg?style=for-the-badge)](https://github.com/openfisca/openfisca-core/graphs/contributors)\n\n[![Newsletter](https://img.shields.io/badge/newsletter-subscribe!-informational.svg?style=for-the-badge)](mailto:contact%40openfisca.org?subject=Subscribe%20to%20your%20newsletter%20%7C%20S'inscrire%20%C3%A0%20votre%20newsletter&body=%5BEnglish%20version%20below%5D%0A%0ABonjour%2C%0A%0AVotre%C2%A0pr%C3%A9sence%C2%A0ici%C2%A0nous%C2%A0ravit%C2%A0!%20%F0%9F%98%83%0A%0AEnvoyez-nous%20cet%20email%20pour%20que%20l'on%20puisse%20vous%20inscrire%20%C3%A0%20la%20newsletter.%20%0A%0AAh%C2%A0!%20Et%20si%20vous%20pouviez%20remplir%20ce%20petit%20questionnaire%2C%20%C3%A7a%20serait%20encore%20mieux%C2%A0!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2F45M0VR1TYKD1RGzX2%0A%0AAmiti%C3%A9%2C%0AL%E2%80%99%C3%A9quipe%20OpenFisca%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20ENGLISH%20VERSION%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0AHi%2C%20%0A%0AWe're%20glad%20to%20see%20you%20here!%20%F0%9F%98%83%0A%0APlease%20send%20us%20this%20email%2C%20so%20we%20can%20subscribe%20you%20to%20the%20newsletter.%0A%0AAlso%2C%20if%20you%20can%20fill%20out%20this%20short%20survey%2C%20even%20better!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2FsOg8K1abhhm441LG2%0A%0ACheers%2C%0AThe%20OpenFisca%20Team)\n[![Twitter](https://img.shields.io/badge/twitter-follow%20us!-9cf.svg?style=for-the-badge)](https://twitter.com/intent/follow?screen_name=openfisca)\n[![Slack](https://img.shields.io/badge/slack-join%20us!-blueviolet.svg?style=for-the-badge)](mailto:contact%40openfisca.org?subject=Join%20you%20on%20Slack%20%7C%20Nous%20rejoindre%20sur%20Slack&body=%5BEnglish%20version%20below%5D%0A%0ABonjour%2C%0A%0AVotre%C2%A0pr%C3%A9sence%C2%A0ici%C2%A0nous%C2%A0ravit%C2%A0!%20%F0%9F%98%83%0A%0ARacontez-nous%20un%20peu%20de%20vous%2C%20et%20du%20pourquoi%20de%20votre%20int%C3%A9r%C3%AAt%20de%20rejoindre%20la%20communaut%C3%A9%20OpenFisca%20sur%20Slack.%0A%0AAh%C2%A0!%20Et%20si%20vous%20pouviez%20remplir%20ce%20petit%20questionnaire%2C%20%C3%A7a%20serait%20encore%20mieux%C2%A0!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2F45M0VR1TYKD1RGzX2%0A%0AN%E2%80%99oubliez%20pas%20de%20nous%20envoyer%20cet%20email%C2%A0!%20Sinon%2C%20on%20ne%20pourra%20pas%20vous%20contacter%20ni%20vous%20inviter%20sur%20Slack.%0A%0AAmiti%C3%A9%2C%0AL%E2%80%99%C3%A9quipe%20OpenFisca%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20ENGLISH%20VERSION%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0AHi%2C%20%0A%0AWe're%20glad%20to%20see%20you%20here!%20%F0%9F%98%83%0A%0APlease%20tell%20us%20a%20bit%20about%20you%20and%20why%20you%20want%20to%20join%20the%20OpenFisca%20community%20on%20Slack.%0A%0AAlso%2C%20if%20you%20can%20fill%20out%20this%20short%20survey%2C%20even%20better!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2FsOg8K1abhhm441LG2.%0A%0ADon't%20forget%20to%20send%20us%20this%20email!%20Otherwise%20we%20won't%20be%20able%20to%20contact%20you%20back%2C%20nor%20invite%20you%20on%20Slack.%0A%0ACheers%2C%0AThe%20OpenFisca%20Team)\n\n[OpenFisca](https://openfisca.org/doc/) is a versatile microsimulation free software. Check the [online documentation](https://openfisca.org/doc/) for more details.\n\nThis package contains the core features of OpenFisca, which are meant to be used by country packages such as [OpenFisca-France](https://github.com/openfisca/openfisca-france). Bootstrapping your own country package should not take more than 5 minutes: check our [country package template](https://github.com/openfisca/country-template).\n\n## Environment\n\nOpenFisca runs on Python 3.7. More recent versions should work but are not tested.\n\nOpenFisca also relies strongly on NumPy. The last four minor versions should work, but only the latest/stable is tested.\n\n## Installation\n\nIf you're developing your own country package, you don't need to explicitly install OpenFisca-Core. It just needs to appear [in your package dependencies](https://github.com/openfisca/openfisca-france/blob/100.0.0/setup.py#L60).\nIf you want to contribute to OpenFisca-Core itself, welcome!\nTo install it locally you can use one of these two options:\n* [conda](https://docs.conda.io/en/latest/) package manager that we recommend for Windows operating system users,\n* or standard Python [pip](https://packaging.python.org/en/latest/key_projects/#pip) package manager.\n\n### Installing `openfisca-core` with `pip`\n\nThis installation requires [Python](https://www.python.org/downloads/) 3.7+ and [GIT](https://git-scm.com) installations.\n\nTo install `openfisca-core` locally in development mode run the following commands in a shell terminal:\n\n```bash\ngit clone https://github.com/openfisca/openfisca-core.git\ncd openfisca-core\npython3 -m venv .venv\nsource .venv/bin/activate\nmake install-deps install-edit\n```\n\n### Installing `openfisca-core` with `conda`\n\nSince `openfisca-core` version [35.7.7](https://anaconda.org/conda-forge/openfisca-core), you could use `conda` to install OpenFisca-Core.\n\nConda is the easiest way to use OpenFisca under Windows as by installing Anaconda you will get:\n- Python\n- The package manager [Anaconda.org](https://docs.anaconda.com/anacondaorg/user-guide/)\n- A virtual environment manager : [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)\n- A GUI [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/index.html) if you choose to install the full [Anaconda](https://www.anaconda.com/products/individual)\n\nIf you are familiar with the command line you could use [Miniconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html), which needs very much less disk space than Anaconda.\n\nAfter installing conda, run these commands in an `Anaconda Powershell Prompt`:\n- `conda create --name openfisca python=3.7` to create an `openfisca` environment.\n- `conda activate openfisca` to use your new environment.\n\nThen, choose one of the following options according to your use case:\n- `conda install -c conda-forge openfisca-core` for default dependencies,\n- or `conda install -c conda-forge openfisca-core-api` if you want the Web API part,\n- or `conda install -c conda-forge -c openfisca openfisca-core-dev` if you want all the dependencies needed to contribute to the project.\n\nFor information on how we publish to conda-forge, see [openfisca-core-feedstock](https://github.com/openfisca/openfisca-core-feedstock/blob/master/recipe/README.md).\n\n## Testing\n\nInstall the test dependencies:\n\n```\nmake install-deps install-edit install-test\n```\n\n> For integration testing purposes, `openfisca-core` relies on\n> [country-template](https://github.com/openfisca/country-template.git) and\n> [extension-template](https://github.com/openfisca/extension-template.git).\n> Because these packages rely at the same time on `openfisca-core`, they need\n> to be installed separately.\n\nTo run the entire test suite:\n\n```sh\nmake test\n```\n\nTo run all the tests defined on a test file:\n\n```sh\npytest tests/core/test_parameters.py\n```\n\nTo run a single test:\n\n```sh\npytest tests/core/test_parameters.py -k test_parameter_for_period\n```\n\n## Types\n\nThis repository relies on MyPy for optional dynamic & static type checking.\n\nAs NumPy introduced the `typing` module in 1.20.0, to ensure type hints do not break the code at runtime, we run the checker against the last four minor NumPy versions.\n\nType checking is already run with `make test`. To run the type checker alone:\n\n```sh\nmake check-types\n```\n\n## Style\n\nThis repository adheres to a [certain coding style](STYLEGUIDE.md), and we invite you to follow it for your contributions to be integrated promptly.\n\nStyle checking is already run with `make test`. To run the style checker alone:\n\n```sh\nmake check-style\n```\n\nTo automatically style-format your code changes:\n\n```sh\nmake format-style\n```\n\nTo automatically style-format your code changes each time you commit:\n\n```sh\ntouch .git/hooks/pre-commit\nchmod +x .git/hooks/pre-commit\n\ntee -a .git/hooks/pre-commit << END\n#!/bin/sh\n#\n# Automatically format your code before committing.\nexec make format-style\nEND\n```\n\n## Documentation\n\nOpenFisca\u2019s toolchain checks whether documentation builds correctly and updates it automatically with each contribution to this repository.\n\nIn the meantime, please take a look at our [contributing guidelines](CONTRIBUTING.md) for some general tips on how to document your contributions, and at our official documentation's [repository](https://github.com/openfisca/openfisca-doc/blob/master/README.md) to in case you want to know how to build it by yourself \u2014and improve it!\n\n## Serving the API\n\nOpenFisca-Core provides a Web-API. It is by default served on the `5000` port.\n\nTo run it with the mock country package `openfisca_country_template` and another port value such as `2000`, run:\n\n```sh\nopenfisca serve --country-package openfisca_country_template --port 2000\n```\n\nTo read more about the `openfisca serve` command, check out its [documentation](https://openfisca.org/doc/openfisca-python-api/openfisca_serve.html).\n\nBy default, the Web API uses 3 workers to avoid [this issue](http://stackoverflow.com/questions/11150343/slow-requests-on-local-flask-server). Without it, AJAX requests from Chrome sometimes take more than 20s to process. You can change the number of workers by specifying a `--workers k` option.\n\nYou can test that the API is running by executing the command:\n\n```sh\ncurl http://localhost:2000/parameters\n```\nFor more information about endpoints and input formatting, see the [official documentation](https://openfisca.org/doc/openfisca-web-api).\n\n### Tracker\n\nThe OpenFisca Web API comes with an [optional tracker](https://github.com/openfisca/tracker) which allows you to measure the usage of the API.\n\n#### Tracker installation\n\nThe tracker is not installed by default. To install it, run:\n\n```sh\npip install openfisca_core[tracker] --use-deprecated=legacy-resolver # Or `pip install --editable \".[tracker]\"` for an editable installation\n```\n\n\n#### Tracker configuration\n\nThe tracker is activated when these two options are set:\n\n* `--tracker-url`: An URL ending with `piwik.php`. It defines the Piwik instance that will receive the tracking information. To use the main OpenFisca Piwik instance, use `https://stats.data.gouv.fr/piwik.php`.\n* `--tracker-idsite`: An integer. It defines the identifier of the tracked site on your Piwik instance. To use the main OpenFisca piwik instance, use `4`.\n* `--tracker-token`: A string. It defines the Piwik API Authentification token to differentiate API calls based on the user IP. Otherwise, all API calls will seem to come from your server. The Piwik API Authentification token can be found in your Piwik interface when you are logged in.\n\nFor instance, to run the Web API with the mock country package `openfisca_country_template` and the tracker activated, run:\n\n```sh\nopenfisca serve --country-package openfisca_country_template --port 5000 --tracker-url https://stats.data.gouv.fr/piwik.php --tracker-idsite 4 --tracker-token $TRACKER_TOKEN\n```\n",
    "bugtrack_url": null,
    "license": "https://www.fsf.org/licensing/licenses/agpl-3.0.html",
    "summary": "A versatile microsimulation free software",
    "version": "41.4.3",
    "project_urls": {
        "Homepage": "https://github.com/openfisca/openfisca-core"
    },
    "split_keywords": [
        "benefit",
        "microsimulation",
        "social",
        "tax"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8d414ef31d1af0c3572ff93197e92d3f8a9f1aef05c02bc96b9b8a37856f59d2",
                "md5": "9c0c04838c44a2f329b11f55693d8aad",
                "sha256": "5d49c63fa050ff83f6cea764dbe7013ac91da0c20744eac7dc562312e3facc01"
            },
            "downloads": -1,
            "filename": "OpenFisca_Core-41.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c0c04838c44a2f329b11f55693d8aad",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 237762,
            "upload_time": "2024-03-18T14:27:41",
            "upload_time_iso_8601": "2024-03-18T14:27:41.615210Z",
            "url": "https://files.pythonhosted.org/packages/8d/41/4ef31d1af0c3572ff93197e92d3f8a9f1aef05c02bc96b9b8a37856f59d2/OpenFisca_Core-41.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f577e18773b130f44b57e38eeb4d4bb2d0f8d6a6644a226f37340243b7a2083a",
                "md5": "a67ef17cff327141c17919ccf0afcf8a",
                "sha256": "a897c39d127cae449d05cf12ccffc417776589c00681f36dcec6f9cbc3380f1c"
            },
            "downloads": -1,
            "filename": "OpenFisca-Core-41.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a67ef17cff327141c17919ccf0afcf8a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 182269,
            "upload_time": "2024-03-18T14:27:46",
            "upload_time_iso_8601": "2024-03-18T14:27:46.550078Z",
            "url": "https://files.pythonhosted.org/packages/f5/77/e18773b130f44b57e38eeb4d4bb2d0f8d6a6644a226f37340243b7a2083a/OpenFisca-Core-41.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 14:27:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openfisca",
    "github_project": "openfisca-core",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "openfisca-core"
}
        
Elapsed time: 0.24688s