Skip to content

Openfisca-NSW/openfisca_nsw_base

Repository files navigation

OpenFisca NSW Base

This repo contains the entities used in NSW. This is so that different rules as code projects in NSW can share the same entities, avoiding duplication.

Packaging OpenFisca NSW for distribution

This base package is already uploaded to PyPI.

https://pypi.org/project/openfisca-nsw-base/

After you make changes, you can bump up the version in setup.py, and run make upload

Install Instructions for Users and Contributors

This package requires Python 3.7. More recent versions should work, but are not tested.

All platforms that can execute Python are supported, which includes GNU/Linux, macOS and Microsoft Windows (in which case we recommend using ConEmu instead of the default console).

Two install procedures are available. Pick procedure A or B below depending on how you plan to use this Country Package.

A. Minimal Installation (Pip Install)

Follow this installation if you wish to:

  • run calculations on a large population;
  • create tax & benefits simulations;
  • write an extension to this legislation (e.g. city specific tax & benefits);
  • serve your Country Package with the OpenFisca Web API.

For more advanced uses, head to the Advanced Installation.

Install this Country Package with Pip Install

Inside your virtualenv, check the prerequisites:

python --version  # should print "Python 3.7.xx".
#if not, make sure you pass the python version as an argument when creating your virtualenv
pip --version  # should print at least 9.0.
#if not, run "pip install --upgrade pip"

Install the Country Package:

pip install openfisca_nsw_base

🎉 This OpenFisca Country Package is now installed and ready!

Next Steps

Depending on what you want to do with OpenFisca, you may want to install yet other packages in your virtualenv:

B. Advanced Installation (Git Clone)

Follow this tutorial if you wish to:

  • create or change this Country Package's legislation;
  • contribute to the source code.

Clone this Country Package with Git

First of all, make sure Git is installed on your machine.

Set your working directory to the location where you want this OpenFisca Country Package cloned.

Inside your virtualenv, check the prerequisites:

python --version  # should print "Python 3.7.xx".
#if not, make sure you pass the python version as an argument when creating your virtualenv
pip --version  # should print at least 9.0.
#if not, run "pip install --upgrade pip"

Clone this Country Package on your machine:

We recommend that you use a virtualenv to install OpenFisca. If you don't, you may need to add --user at the end of all commands starting by pip.

python -m venv openfisca 
deactivate
source openfisca/bin/activate
python -m pip install --editable . --user
make build
make install

You can make sure that everything is working by running the provided tests with make test.

Learn more about tests

🎉 This OpenFisca Country Package is now installed and ready! You can begin working on your legislation in an extension package.