GithubHelp home page GithubHelp logo

atouboulic / openfisca-pf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from govpf/openfisca-pf

0.0 0.0 0.0 509 KB

French Polynesian tax system for OpenFisca https://hub.docker.com/r/govpf/openfisca-pf

License: GNU Affero General Public License v3.0

Shell 0.10% Python 99.46% Makefile 0.29% Dockerfile 0.15%

openfisca-pf's Introduction

OpenFisca PF

This is the package modelling the French Polynesia tax system. What is currently modelled:

  • CST-S
  • IT
  • CST-NS

But this is a work in progress and none of those taxes are validated yet.

Installation for developpers and maintainers

Installation does not work on windows despite using Python, but it is working well in a WSL. To install WSL on Windows 10: https://docs.microsoft.com/fr-fr/windows/wsl/install-win10

To install it first get the git repo :

git clone https://github.com/govpf/openfisca-pf.git

Then make sure you have all dependencies (this example is for Ubuntu or Debian based distro):

sudo apt-get update
sudo apt upgrade
sudo apt-get install make python3-pip

Pip is named pip 3 in Ubuntu so you should add an alias:

echo "alias pip='pip3'" >> ~/.bash_aliases
source ~/.bashrc

Then you can install openfisca :

cd openfisca-pf
pip install --editable .[dev] --upgrade

Then make sure your openfiscal installation is in your path:

echo "export PATH=$HOME/.local/bin:${PATH}:" >> ~/.bashrc
source ~/.bashrc

Running all the tests

To run all non regression tests you have to execute :

openfisca test --country-package openfisca_pf openfisca_pf/tests

Serve this Country Package with the OpenFisca Web API

To serve the Openfisca Web API locally, run:

openfisca serve --configuration-file config.py

To read more about the openfisca serve command, check out its documentation.

You can make sure that your instance of the API is working by requesting:

curl "http://localhost:5000/spec"

This endpoint returns the Open API specification of your API.

๐ŸŽ‰ This OpenFisca Country Package is now served by the OpenFisca Web API! To learn more, go to the OpenFisca Web API documentation.

You can test your new Web API by sending it example JSON data located in the situation_examples folder.

Substitute your package's country name for openfisca_pf below:

curl -X POST -H "Content-Type: application/json" \
  -d @./openfisca_pf/situation_examples/couple.json \
  http://localhost:5000/calculate

Run or Build an Openfisca-pf docker image

To run the offical latest Openfisca-pf image simply run :

docker run -p 5000:5000 govpf/openfisca-pf:latest

But if you want to build it yourself, while being in the main directory of the project run :

docker build --tag openfisca-pf-mytag . -f docker/Dockerfile

Then you may run this image :

docker run -p 5000:5000 openfisca-pf-mytag

openfisca-pf's People

Contributors

masterbox avatar dependabot[bot] avatar jpigree avatar mael-congard-sipf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.