Registry / data / cpi
library2.0.10pypypiunverified

Quickly adjust U.S. dollars for inflation using the Consumer Price Index (CPI). Uses FRED data. Current version 2.0.10, actively maintained with regular data updates.

pip install cpi
INSTALL
IMPORT
SIG · CPI
C
cpi
datapythonv2.0.10
Install
8.6s avg
Import
—
Disk
228MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.0.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 228.4MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 8.6s · import 0.000s · 221MB
228MB installed
● package 228MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cpi.to_usd
✓ from cpi import to_usd
✗ import cpi; cpi.to_usd()
Direct import is the common pattern; avoid relying on module-level import for the function.
adjust
✓ from cpi import adjust
✗ import cpi; cpi.adjust()
adjust is the recommended API; from cpi import adjust is cleaner.

Adjust $100 from 1990 to 2023 dollars.

from cpi import to_usd print(to_usd(100, 1990, 2023))
cpi --version
Debug
Known issues
deprecatedcpi.to_usd() is deprecated in favor of adjust()
fix
Use from cpi import adjust; adjust(100, 1990, 2023)
affects: >=2.0.0
gotchaYear ranges are inclusive for the start year; end year is exclusive (i.e., data up to but not including end year).
fix
To adjust from 2020 to 2023, use to_usd(amount, 2020, 2023). It uses CPI data through 2022.
affects: all
gotchaFirst run downloads CPI data from FRED; requires internet. Subsequent runs use a local cache.
fix
Ensure internet access on first use. Cache location: ~/.cpi/ on Linux/macOS.
affects: all
Upgrade
Version history
2.0.10latest on PyPI · released Jan 13, 2026
Audit
Dependencies
requestsrequiredFetch CPI data from FRED API
pandasoptionalData handling and time series operations
Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
1
Resources
cpi — pip install cpi · libregistry