Skip to content

Dollarwave v2.0.2

Choose a tag to compare

@cedricmoorejr cedricmoorejr released this 22 Jul 14:44
· 8 commits to main since this release
15d14d1

dollarwave Logo

Dollarwave v2.0.2 - 2024-07-22

New Features

  • Graphical User Interface (GUI)
    • Introduced a new GUI for user-friendly inflation calculations.
    • Users can now calculate:
      • The inflation-adjusted value of an amount from the original year to the target year.
      • The historical value change of a given dollar amount over the past n years.
      • The value of a given amount against the CPI values for each month of the current year.

Enhancements

  • Improved the InflationCalculator to handle edge cases more effectively.
  • Added methods for current year CPI changes and historical comparisons.

Bug Fixes

  • Fixed an issue where monthly CPI data was not correctly falling back to yearly averages.
  • Corrected the CPI data validation process to handle missing data more gracefully.
  • Resolved inconsistencies in the inflation adjustment calculations for specific years.

Usage Examples

from dollarwave import GUI

# Run the GUI
GUI.run()
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.calculate_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