Skip to content

Commit

Permalink
some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin committed Aug 19, 2024
1 parent 80525a0 commit b852a8b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,49 @@ cache True for eficient requests. Only checks request result for the current day
print(res.data)
print(res.metadata)
.. code-block:: python
from evdspy import get_series_exp
reserves = """
TP.AB.TOPLAM # Central Bank Reserves
"""
result = get_series_exp(reserves, frequency="monthly", start_date="01-01-1994" , aggregation ="avg")
df = result.data
print(df.head())
df.to_excel("data.xlsx") # only data
result.to_excel("result.xlsx") # data and metadata sheets together
.. code-block:: python
from evdspy import get_series_exp
cpi_table = """
bie_tukfiy4 # CPI
"""
inf_exp_table = """
bie_enfbek # inflation expectations
"""
reserves_table = """
bie_abres2 # reserves
"""
def clean_name(name : str ) :
return name.replace("\n" , "" ).replace(" " , "")
for index in [cpi_table, inf_exp_table, reserves_table]:
res = get_series_exp(index, cache=True, start_date="01-01-2010")
print(res.data)
print(res.metadata)
res.to_excel(clean_name(index) + ".xlsx")

0 comments on commit b852a8b

Please sign in to comment.