diff --git a/readme.py b/readme.py index 9ef7ab6..d7ac05e 100644 --- a/readme.py +++ b/readme.py @@ -27,8 +27,8 @@ pathlib.Path("weo_data").mkdir(parents=False, exist_ok=True) # download all releases -for (year, release) in weo.all_releases(): - weo.download(year, release, directory="weo_data") +for year, release in weo.all_releases(): + weo.download(year, release, directory="weo_data") from weo import WEO @@ -46,9 +46,9 @@ w.from_code("LUR") # countries -w.countries("United") # Dataframe with United Arab Emirates, United Kingdom - # and United States -w.iso_code3("Netherlands") # 'NLD' +w.countries("United") # Dataframe with United Arab Emirates, United Kingdom +# and United States +w.iso_code3("Netherlands") # 'NLD' w.get("General government gross debt", "Percent of GDP") @@ -56,17 +56,20 @@ w.country("DEU") w.fix_year(1994) -(w.gdp_usd(2024) - .dropna() - .sort_values() - .tail(12) - .plot - .barh(title="GDP by country, USD billion (2024)") +( + w.gdp_usd(2024) + .dropna() + .sort_values() + .tail(12) + .plot.barh(title="GDP by country, USD billion (2024)") ) w.gdp_pc_usd(start_year=2000, end_year=2020) from dbnomics import fetch_series_by_api_link -ts1 = fetch_series_by_api_link("https://api.db.nomics.world/v22/" - "series/IMF/WEO:latest/DEU.PCPI" - "?observations=1") + +ts1 = fetch_series_by_api_link( + "https://api.db.nomics.world/v22/" + "series/IMF/WEO:latest/DEU.PCPI" + "?observations=1" +) diff --git a/weo/__init__.py b/weo/__init__.py index dd77c10..0c12aa1 100644 --- a/weo/__init__.py +++ b/weo/__init__.py @@ -4,12 +4,13 @@ from .dataframe import WEO from .dates import all_releases, download -# addd everything to all -__all__ = ["all_releases", "download", "WEO", "get"] +# Add everything to all +__all__ = ["all_releases", "download", "get", "WEO"] def get(year: int, release: int, path: Optional[str] = None) -> WEO: - """Fast-track access to dataset - download if not present, + """Fast-track access to dataset: + download if not present, read from file if already downloaded. """ from .dates import accept