OpenFisca
What:これは何?
Who:誰が作っている?
Why:なぜ必要?
How:どうやって動いている?
code:python
class flat_tax_on_salary(Variable):
value_type = float
entity = Person
definition_period = MONTH
label = u"Individualized and monthly paid tax on salaries"
def formula(person, period):
salary = person('salary', period)
return salary * 0.25
テストがYAMLなのは面白いyuiseki.icon code:yaml
- name: "Flax tax on salary - No income"
period: 2017-01
input:
salary: 0
output:
flat_tax_on_salary: 0
- name: "Flax tax on salary - With income"
period: 2017-01
input:
salary: 2000
output:
flat_tax_on_salary: 500
関連