Skip to content

Mexico Consumer Price Index Inflation Calculator (INPC)

License

Notifications You must be signed in to change notification settings

portfedh/Mexico_CPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mexico Inflation Calculator

What it does

A simple script used to determine inflation in Mexico between two periods.

The program connects through an API to the National Institute of Statistics and Geography in Mexico (INEGI) and retrieves the relevant monthly Consumer Price Index (INPC) values.

  • The user will input an initial and final date.

  • The script will then output the index values for each month.

  • It will also calculate the inflation percentage for the period.

How to Install

To use this script, you must have previously installed python 3 and the following python libraries:

  • Python 3
  • IPython
  • Pandas
  • Numpy
  • Requests

You will also need a (free) API token from INEGI, which can be obtained here: INEGI API KEY

Once you have the API token, paste it in the file named: api_key_blank.py

Rename the file to api_key.py

You can then run the python script from terminal.

How to Use

When running the script, the terminal will automatically display the last value in Mexican Consumer Price Index (INPC) and will ask for two dates from the user in the format: yyy-mm

The program will then retrieve the monthly index values during the period and calculate the inflation between the two dates.

Output will display the inflation for the period, as well as the Index values of the period.

INPC_example

Use cases

The script may be useful for accountants, administrative, financial professionals or anyone who needs to determine inflation over specific time periods.

It can help to quickly determine adjustments for:

  • Rent prices.
  • A stock's inflation adjusted cost basis.
  • A salary increase to maintain purchasing power.
  • Any asset value that is periodically adjusted for inflation.

Contributing

Any help making the script into an executable file for windows and mac would be very helpful.

This would allow non-programmers to use it.

About

Mexico Consumer Price Index Inflation Calculator (INPC)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages