forked from TPRU-India/taxcalc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app1_keshav.py
29 lines (24 loc) · 943 Bytes
/
app1_keshav.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
app1_keshav.py illustrates use of TPRU-India taxcalc release 2.0.0
USAGE: python app1_keshav.py
"""
from taxcalc import *
# create Records object containing pit.csv and pit_weights.csv input data
recs = Records()
# create Policy object containing current-law policy
pol = Policy()
# specify Calculator object for current law policy
calc1 = Calculator(policy=pol, records=recs)
calc1.calc_all()
#specify Calculator object for reform in JSON file
reform = Calculator.read_json_param_objects('app_usa_reform_keshav.json', None)
pol.implement_reform(reform['policy'])
calc2 = Calculator(policy=pol,records=recs)
calc2.calc_all()
# compare aggregate results from two calculators
weighted_tax1 = calc1.weighted_total('pitax')
weighted_tax2 = calc2.weighted_total('pitax')
total_weights = calc1.total_weight()
print('Tax1 in Rs. crore', weighted_tax1*1e-7)
print('Tax2 in Rs. crore', weighted_tax2*1e-7)
print('Total weight', total_weights)