Skip to content

Commit

Permalink
Update bootstrapping script
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagnoux committed May 16, 2017
1 parent 3ea01f7 commit 8cb3297
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# OpenFisca country package template
# OpenFisca Country-Template

This repository is here to help you quickly bootstrap and use your own OpenFisca country package.


## Bootstrapping a country package

This set of instructions will create your own copy of this boilerplate directory and customise it to the country you want to work on:

```sh
COUNTRY_NAME=France # set the name of your country here; you should keep all capitals, and replace any spaces in the name by underscores
URL=https://github.com/openfisca/openfisca-france # set here the URL of the repository where you will publish your code.

lowercase_country_name=$(echo $COUNTRY_NAME | tr '[:upper:]' '[:lower:]')

Expand All @@ -18,15 +18,16 @@ git clone https://github.com/openfisca/country-template.git # download this tem
mv country-template openfisca-$lowercase_country_name
cd openfisca-$lowercase_country_name
git remote remove origin
sed -i '' "s/country_template/$lowercase_country_name/g" MANIFEST.in openfisca_country_template/base.py openfisca_country_template/model.py
sed -i '' "s/Country-Template/$COUNTRY_NAME/g" setup.py
sed -i '' '3,27d' README.md
sed -i '' "s|country_template|$lowercase_country_name|g" README.md setup.py check-version-bump.sh `find openfisca_country_template -type f`
sed -i '' "s|Country-Template|$COUNTRY_NAME|g" README.md setup.py check-version-bump.sh .github/PULL_REQUEST_TEMPLATE.md CONTRIBUTING.md `find openfisca_country_template -type f`
sed -i '' "s|https://github.com/openfisca/openfisca-country-template|$URL|g" setup.py
mv openfisca_country_template openfisca_$lowercase_country_name
rm README.md
```

## Writing the legislation

The country whose law is modelled in this template has a very simple tax and benefit system.
The country whose law is modelled here has a very simple tax and benefit system.

- It has a flat rate tax whose rates increase every year.
- On the first of December, 2015, it introduced a basic income for all its citizens of age who have no income.
Expand All @@ -47,13 +48,13 @@ The files that are outside from the `openfisca_country_template` folder are used
To install your country package, run:

```
pip install -e .
pip install -e ".[test]"
```

You can make sure that everything is working by running the provided test:

```sh
openfisca-run-test openfisca_$COUNTRY_NAME/test.yaml
make test
```

> [Learn more about tests](https://doc.openfisca.fr/coding-the-legislation/writing_yaml_tests.html)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version='1.0.0',
author='OpenFisca Team',
author_email='contact@openfisca.fr',
description=u'Template of a tax and benefit system for OpenFisca',
description=u'OpenFisca tax and benefit system for Country-Template',
keywords='benefit microsimulation social tax',
license='http://www.fsf.org/licensing/licenses/agpl-3.0.html',
url='https://github.com/openfisca/openfisca-country-template',
Expand Down

0 comments on commit 8cb3297

Please sign in to comment.