Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin committed Apr 19, 2024
1 parent 8da5baf commit efe62d5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/source/get_series.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

get_series Function
===================
The ``get_series`` function is designed to fetch economic data series from a specified API and return it formatted as a pandas DataFrame, making extensive use of various parameters to fine-tune the data retrieval process.

.. autofunction:: evdspy.get_series

Parameters
----------
index : str or tuple
Expand All @@ -27,34 +28,48 @@ debug : bool, optional
If True, runs the function in debug mode, providing additional debug information without making a real API request. Default is False.
api_key : str, optional
The API key required for accessing the data. Initially, it can be saved using the ``save("APIKEY")`` function or via command line with ``$ evdspy save``.

Returns
-------
pd.DataFrame
A pandas DataFrame containing the retrieved data series.

Raises
------
ValueError
Raised if an invalid API key is provided or required parameters are missing.

Examples
--------
Basic usage:

.. code-block:: python
index = "TP.ODEMGZS.BDTTOPLAM"
df = get_series(index, start_date="01-01-2020", end_date="01-01-2021", frequency="monthly")
print(df.head())
Using multiple indexes and cache:

.. code-block:: python
indexes = ("TP.ODEMGZS.BDTTOPLAM", "TP.ODEMGZS.ABD")
df = get_series(indexes, start_date="01-01-2020", frequency="monthly", cache=True)
print(df.head())
.. code-block:: python
template = """
TP.ODEMGZS.BDTTOPLAM
TP.ODEMGZS.ABD
"""
df = get_series(template, start_date="01-01-2020", frequency="monthly", cache=True)
print(df.head())
Applying formulas and aggregation:

.. code-block:: python
df = get_series(template, start_date="01-01-2020", formulas="level", aggregation="sum")
print(df.head())
print(df.head())

0 comments on commit efe62d5

Please sign in to comment.