Skip to main content

A Python library for inflation adjustment calculations using Consumer Price Index (CPI) data.

Project description

dollarwave Logo

Dollarwave Library: Inflation Adjustment Using CPI Data

The dollarwave module is a comprehensive library designed for adjusting the value of money across different years using Consumer Price Index (CPI) data. It offers extensive capabilities to handle and process CPI data, ensuring accurate inflation adjustments.

Table of Contents

  1. Why dollarwave?
  2. Key Features
  3. Usage Examples
  4. Installation
  5. Contributing
  6. License

Why dollarwave?

  • Accurate Inflation Adjustments: Utilizes CPI data to calculate the equivalent value of money across different years.
  • Easy to Use: Provides a straightforward API for calculating inflation-adjusted values.
  • Data Validation: Ensures the accuracy and consistency of CPI data used in calculations.

Key Features

  1. Inflation Adjustment Calculation:

    • Calculates the equivalent value of an amount of money in different years using CPI data.
    • Automatically switches to yearly averages if monthly data is not available for the most recent comparison year.
  2. Data Handling and Validation:

    • Validates CPI data to ensure it meets the required criteria.
    • Converts and processes CPI data for easy manipulation and calculation.
  3. Graphical User Interface (GUI):

    • User-friendly interface for performing inflation calculations without writing code.

Usage Examples

Calculating Inflation-Adjusted Values

Use the inflation_calculator to calculate the equivalent value of money across different years:

from dollarwave import inflation_calculator

# Calculate the adjusted value
original_amount = 1
original_year = 1970
target_year = 2024
adjusted_amount = inflation_calculator(original_amount, original_year, target_year)

Output:

$1 from 1970 is equivalent to $8.04 in 2024 dollars.
8.044961340206186

Using the GUI

You can also use the graphical user interface (GUI) to perform inflation calculations:

from dollarwave import GUI

# Run the GUI
GUI.run()

From the GUI, you can:

  • Calculate the inflation-adjusted value of an amount from the original year to the target year using CPI data.
  • Calculate the historical value change of a given dollar amount over the past n years compared to the current month's CPI.
  • Calculate the value of a given amount against the CPI values for each month of the current year where data is available.

GUI Screenshots

Here are some screenshots of the GUI in action:

  • Adjusted Value Tab

Adjusted Value Tab

  • Current Year Change Tab

Current Year Change Tab

  • Comparison Tab

Comparison Tab

Alternatively, you can use the inflation_calculator instance directly:

from dollarwave import inflation_calculator

# Calculate the current year change
print(inflation_calculator.current_year_change(amount=5))

Output:

{'January': 4.94, 'February': 4.97, 'March': 5.0, 'April': 5.02, 'May': 5.03, 'June': 5.03}
# Calculate historical comparison
print(inflation_calculator.comparison(amount=10, n_years=3, plot=False))

Output:

$10 from 2021 is equivalent to $8.68 in 2024 dollars.
$10 from 2022 is equivalent to $9.38 in 2024 dollars.
$10 from 2023 is equivalent to $9.76 in 2024 dollars.
{2021: 8.68, 2022: 9.38, 2023: 9.76}
# Calculate adjusted value
adjusted_amount = inflation_calculator.adjusted_value(amount=13, original_year=1991, target_year=2021)
print(f"${13} from {1991} is equivalent to ${adjusted_amount:.2f} in {2021} dollars.")

Output:

$13 from 1991 is equivalent to $25.86 in 2021 dollars.
25.86

Installation

To install the dollarwave library, use pip:

pip install dollarwave

Contributing

Contributions are welcome! Please read the contribution guidelines first.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

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

Source Distribution

dollarwave-2.0.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

dollarwave-2.0.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file dollarwave-2.0.2.tar.gz.

File metadata

  • Download URL: dollarwave-2.0.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.5

File hashes

Hashes for dollarwave-2.0.2.tar.gz
Algorithm Hash digest
SHA256 ef72815a861781e207a672d7b3f60b49eaa26e7ffb0903a3ad1f050aa9eeb770
MD5 48c2f62c0a98cfc3a12c8527064827a9
BLAKE2b-256 9e9359531b7fbcc1a0b3a6a580fafe5d081669aaa98716cbb629206b0ed89238

See more details on using hashes here.

File details

Details for the file dollarwave-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: dollarwave-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.5

File hashes

Hashes for dollarwave-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b5e5854832838a0deb6aac3608b36fd39bc51fe65fff3793f75dd7e08037e39
MD5 884fd45166d262ba586bf6c5a0e31329
BLAKE2b-256 2be4befbd820dabedabda7df500ef1a24cca01d430a2c645433bc92dc14a027d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page