Skip to content

Commit

Permalink
added just install command
Browse files Browse the repository at this point in the history
  • Loading branch information
epogrebnyak committed Apr 21, 2024
1 parent cec3186 commit 837b38d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
31 changes: 17 additions & 14 deletions readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -46,27 +46,30 @@
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")
w.getc("NGDP_RPCH")
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"
)
7 changes: 4 additions & 3 deletions weo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 837b38d

Please sign in to comment.