Calculate the 2016 value of amount paid to McFarlands for parking lot and wharf

We paid $15,000 each year from 1988 to 2007 (20 years). Using the CPI calculator at http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2016&year2=1988, we can calculate the total value in current dollars. This will not be completely accurate as we made two payments each year, not one. But it will be very close.


In [1]:
import requests
from lxml import html
from re import sub
from decimal import Decimal

In [2]:
payment = 15000
target_year = 2016
dollars_2016 = 0
for year in range(1988,2008):
    url='http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=%i&year1=%i&year2=%i' % (payment,year, target_year)
    print(url)
    page = requests.get(url)
    tree = html.fromstring(page.content)
    money = tree.xpath('//span[@id="answer"]/text()')[0]
    print(money)
    value = Decimal(sub(r'[^\d.]', '', money))
    dollars_2016 += value


http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1988&year2=2016
$30,513.14
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1989&year2=2016
$29,110.52
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1990&year2=2016
$27,618.25
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1991&year2=2016
$26,502.97
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1992&year2=2016
$25,728.47
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1993&year2=2016
$24,980.66
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1994&year2=2016
$24,356.98
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1995&year2=2016
$23,685.73
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1996&year2=2016
$23,006.41
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1997&year2=2016
$22,490.37
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1998&year2=2016
$22,145.43
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=1999&year2=2016
$21,666.90
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2000&year2=2016
$20,962.28
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2001&year2=2016
$20,382.30
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2002&year2=2016
$20,065.06
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2003&year2=2016
$19,617.96
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2004&year2=2016
$19,109.08
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2005&year2=2016
$18,482.87
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2006&year2=2016
$17,905.28
http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=15000&year1=2007&year2=2016
$17,409.43

In [3]:
print(dollars_2016)


455740.09

So that's a total of $455,740!


In [ ]: