Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Functions and data manipulation for economics data

Project Description

economics provides a toolkit with economical computations based on data from


  • CPI
  • Inflation (based on CPI by default)



>> from economics import CPI
>> import datetime
>> # Create a new CPI instance
>> cpi = CPI()
>> # Get CPI for Iceland in 2007
>> cpi.get(,1,1), 'Iceland')
CPI(, 1, 1), value=112.07753358)
>> # We're going to work with Iceland so set default country
>> # (we're creating a new instance but the country variable can be set)
>> iceland = CPI(country='Iceland')
>> # Get CPI in 2012 (not in the data)
>> iceland.get(,1,1))
KeyError: 'Date 2012-01-01 not found in data'
>> # Get the closest CPI value sintead
>> iceland.closest(,1,1))
CPI(, 1, 1), value=155.03663004)


>> from economics import Inflation
>> import datetime
>> # Create a new Inflation instance
>> inflation = Inflation()
>> # How many US $ would I need in 2011 to pay for what cost $5 in 2007
>> inflation.inflate(5,,1,1),,1,1), 'United States')
>> # We can also set the reference year and the country
>> usa_2007 = Inflation(,1,1), country='United States')
>> # Get the inflation for 2007 in the United States
>> usa_2007.get(,1,1))
Inflation(factor=1.0848680664757249, value=0.08486806647572484)


economics is available under the GNU General Public License, version 3. See LICENCE for more details.

Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
economics-0.1.2.tar.gz (17.2 kB) Copy SHA256 Checksum SHA256 Source Oct 1, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting