v2.0.0
2.0.0 is a breaking release. REF_AREA_CODE on the bulk SDMX path changes from the numeric IMF area code to ISO3 or a G-prefixed aggregate code, UNIT_CODE and the label columns follow the API codelists on both paths, and rows with a null OBS_VALUE are dropped. Historical row counts fall by roughly a third. REF_AREA_IMF_CODE carries the old numeric code for anyone migrating off it.
It also restores the eleven pre-April-2025 releases, which every version since the IMF put its download page behind bot management has been unable to fetch, and raises the Python floor to 3.12.
weo.get_weo_versions()now reports every WEO release this package can fetch — the API's
dataflow mapping plus the discontinued bulk SDMX archive (April 2019 through April 2025) —
instead of only the two versions the API currently exposes. It is now exported from
imf_reader.weo.get_weo_data(version=None)is unaffected: it still resolves "latest" against
the API mapping alone.- April 2021 and October 2023 are corrupt in the IMF's own published SDMX archive and cannot be
fetched by any means.get_weo_versions()omits them; fetching one raises
cache.BulkPayloadCorruptErrorwithis_retryable=Falseand an explanation. See the README's
"Coverage and known issues" section. - The pre-April-2025 historical path (the bulk SDMX archive) is fetchable again. In v1.5.0 the IMF
put its download page behind bot management and every one of those eleven releases raised
ConnectionError;fetch_datacan now reach all of them. - The bulk SDMX path and the API path now return the same identifier vocabulary.
REF_AREA_CODE
is ISO3 (e.g.USA) or aG-prefixed aggregate code (e.g.G001) on both paths, where the
bulk path previously returned the legacy numeric area code.UNIT_CODE,REF_AREA_LABEL,
UNIT_LABEL, andCONCEPT_LABELnow follow the API's vocabulary and codelists on both paths
too. This is a breaking change for the bulk SDMX path. - Rows with a null
OBS_VALUEare now dropped on both paths. Historical row counts fall by
roughly a third, and about 7 series-level notes are dropped along with the rows that carried
them. PPPGDP,PPPPC,PPPEX, andNGDPRPPPPCnow have a nullUNIT_CODE, where the legacy data
carriedT,F, andS. This is deliberate, not a regression: the IMF's own API publishes no
unit at all for these four PPP / "international dollar" concepts, andCL_UNIThas no code for
"international dollar" to translate to.LE,LP, andLURcarry aUNIT_CODE(PE,PT) on releases served from the bulk archive
(April 2019 to April 2025) and a null one on releases served from the API (April 2025 onward).
The API publishes no unit for these concepts either, and the bulk archive's unit depends on the
area as well as the concept, so it cannot be carried forward to areas the API adds later. Code
that readsUNIT_CODEfor population, employment, or unemployment should not assume it is
populated across versions;CONCEPT_CODEandCONCEPT_LABELare stable for these series.- A new
REF_AREA_IMF_CODEcolumn is added on both paths, carrying the legacy numeric IMF area
code for each row (null for areas that never had one, e.g.LIE). It's a compatibility column
for code migrating off the numeric area code, and is slated for removal in 3.0. imf-readernow requires Python 3.12 or later. Users on Python 3.10 or 3.11 keep resolving to
the 1.5.x series.- The default cache directory moves to a shared
readerkitroot:~/.cache/readerkit/v1/imf-reader/<version>/
on Linux,~/Library/Caches/readerkit/v1/imf-reader/<version>/on macOS, and
%LOCALAPPDATA%\readerkit\Cache\v1\imf-reader\<version>\on Windows. Users on Linux who want to
reclaim disk space from the old directory can runrm -rf ~/.cache/imf_reader/after upgrading. - A new environment variable
BBLOCKS_CACHE_DIRprovides a family-wide fallback cache location,
used whenIMF_READER_CACHE_DIRis not set. Useful for pointing several packages at one shared
cache root. - HTTP requests now carry a default timeout and retry with backoff on transient failures and
server errors. - WEO bulk SDMX downloads now stream to disk and verify the transfer against the response's
Content-Lengthheader. - The cache directory now uses readerkit's native file lock by default, instead of the
SoftFileLockthatimf-reader1.5.0 always used. On a filesystem that rejects native locks,
such as an NFS mount, readerkit raisesCacheLockUnavailableand names the fix in the error.
SetREADERKIT_LOCK_STRATEGY=strict-softto restore marker-file locking. - A failed fetch can now raise
ArtifactWriteError,CacheLockTimeout,CacheLockUnavailable,
TruncatedDownloadError,SessionForkError,CacheDirectoryError, orRedirectPolicyError
from the underlying caching library, in addition to the exceptionsimf-readeralready raised. weo.clear_cache(),weo.api.clear_cache(), andsdr.clear_cache()survive this release. v1.5.0
announced their removal in 2.0; they still work and still emit aDeprecationWarning, and the
removal moves to 3.0 alongsideREF_AREA_IMF_CODE.- The public
imf_reader.cacheAPI is otherwise unchanged.