Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin committed Aug 19, 2024
1 parent ea990e4 commit ebe6f4e
Show file tree
Hide file tree
Showing 39 changed files with 469 additions and 688 deletions.
Binary file removed docs/build/.DS_Store
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/examples.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/get_series.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/get_series_exp.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/home.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/homeEski.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
Binary file removed docs/build/html/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../../../../home.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api_key.html">Proxy Configuration</a></li>


<li class="toctree-l1"><a class="reference internal" href="../../../../get_series.html">get_series Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../get_series_exp.html">get_series_exp Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../setup.html">setup Function</a></li>
Expand All @@ -159,6 +162,7 @@
<li class="toctree-l1"><a class="reference internal" href="../../../../proxy.html">Proxy Configuration</a></li>


<li class="toctree-l1"><a class="reference internal" href="../../../../examples.html">Examples</a></li>
</ul>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../../../../home.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api_key.html">Proxy Configuration</a></li>


<li class="toctree-l1"><a class="reference internal" href="../../../../get_series.html">get_series Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../get_series_exp.html">get_series_exp Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../setup.html">setup Function</a></li>
Expand All @@ -159,6 +162,7 @@
<li class="toctree-l1"><a class="reference internal" href="../../../../proxy.html">Proxy Configuration</a></li>


<li class="toctree-l1"><a class="reference internal" href="../../../../examples.html">Examples</a></li>
</ul>

</div>
Expand Down Expand Up @@ -270,7 +274,7 @@ <h1>Source code for evdspy.EVDSlocal.index_requests.get_series_indexes_exp</h1><
<span class="n">default_start_date_fnc</span><span class="p">,</span>
<span class="n">default_end_date_fnc</span><span class="p">,</span>
<span class="p">)</span>

<span class="kn">from</span> <span class="nn">evdspy.EVDSlocal.index_requests.get_series_indexes</span> <span class="kn">import</span> <span class="n">get_series</span>

<span class="k">def</span> <span class="nf">initial_api_process_when_given</span><span class="p">(</span><span class="n">api_key</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">evdspy.EVDSlocal.config.apikey_class</span> <span class="kn">import</span> <span class="n">ApikeyClass</span>
Expand Down Expand Up @@ -350,8 +354,8 @@ <h1>Source code for evdspy.EVDSlocal.index_requests.get_series_indexes_exp</h1><
<span class="n">aggregation</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span>
<span class="n">Literal</span><span class="p">[</span><span class="s2">&quot;avg&quot;</span><span class="p">,</span> <span class="s2">&quot;min&quot;</span><span class="p">,</span> <span class="s2">&quot;max&quot;</span><span class="p">,</span> <span class="s2">&quot;first&quot;</span><span class="p">,</span> <span class="s2">&quot;last&quot;</span><span class="p">,</span> <span class="s2">&quot;sum&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">],</span> <span class="kc">None</span>
<span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">cache</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="n">meta_cache</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="n">cache</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span> <span class="p">,</span>
<span class="n">meta_cache</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span> <span class="p">,</span>
<span class="n">proxy</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">proxies</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">debug</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
Expand Down Expand Up @@ -420,23 +424,27 @@ <h1>Source code for evdspy.EVDSlocal.index_requests.get_series_indexes_exp</h1><
<span class="n">aggregation</span><span class="o">=</span><span class="n">aggregation</span><span class="p">,</span>
<span class="n">cache</span><span class="o">=</span><span class="n">cache</span><span class="p">,</span>
<span class="p">)</span>
<span class="c1"># ............ProxyManager................................</span>
<span class="c1"># # ............ProxyManager................................</span>
<span class="n">proxy_manager</span> <span class="o">=</span> <span class="n">ProxyManager</span><span class="p">(</span><span class="n">proxy</span><span class="o">=</span><span class="n">proxy</span><span class="p">,</span> <span class="n">proxies</span><span class="o">=</span><span class="n">proxies</span><span class="p">)</span>
<span class="c1"># ............UrlBuilder..................................</span>
<span class="n">url_builder</span> <span class="o">=</span> <span class="n">UrlBuilder</span><span class="p">(</span><span class="n">config</span><span class="p">,</span> <span class="n">url_type</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
<span class="c1"># ............ApiRequester................................</span>
<span class="n">api_requester</span> <span class="o">=</span> <span class="n">ApiRequester</span><span class="p">(</span><span class="n">url_builder</span><span class="p">,</span> <span class="n">proxy_manager</span><span class="p">)</span>
<span class="k">if</span> <span class="n">debug</span><span class="p">:</span>
<span class="k">return</span> <span class="n">api_requester</span><span class="o">.</span><span class="n">dry_request</span><span class="p">()</span>
<span class="c1"># ............DataProcessor................................</span>
<span class="n">data_processor</span> <span class="o">=</span> <span class="n">DataProcessor</span><span class="p">(</span><span class="n">api_requester</span><span class="p">())</span>

<span class="c1"># Fetch the main data</span>
<span class="n">main_data</span> <span class="o">=</span> <span class="n">data_processor</span><span class="p">()</span>

<span class="c1"># Fetch metadata for each index</span>
<span class="c1"># # ............UrlBuilder..................................</span>
<span class="c1"># url_builder = UrlBuilder(config, url_type=None)</span>
<span class="c1"># # ............ApiRequester................................</span>
<span class="c1"># api_requester = ApiRequester(url_builder, proxy_manager)</span>
<span class="c1"># if debug:</span>
<span class="c1"># return api_requester.dry_request()</span>
<span class="c1"># # ............DataProcessor................................</span>
<span class="c1"># data_processor = DataProcessor(api_requester())</span>

<span class="c1"># main_data = data_processor()</span>
<span class="n">main_data</span> <span class="o">=</span> <span class="n">get_series</span><span class="p">(</span><span class="n">index</span> <span class="p">,</span>
<span class="n">start_date</span><span class="o">=</span><span class="n">start_date</span><span class="p">,</span>
<span class="n">end_date</span><span class="o">=</span><span class="n">end_date</span><span class="p">,</span>
<span class="n">frequency</span><span class="o">=</span><span class="n">frequency</span><span class="p">,</span>
<span class="n">formulas</span><span class="o">=</span><span class="n">formulas</span><span class="p">,</span>
<span class="n">aggregation</span><span class="o">=</span><span class="n">aggregation</span><span class="p">,</span>
<span class="n">cache</span><span class="o">=</span><span class="n">cache</span> <span class="p">)</span>

<span class="n">metadata_</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span> <span class="o">=</span> <span class="n">get_metadata_for_index</span><span class="p">(</span><span class="n">index</span><span class="p">,</span> <span class="n">proxy_manager</span><span class="p">,</span> <span class="n">cache</span><span class="o">=</span><span class="n">meta_cache</span><span class="p">)</span>
<span class="c1"># return pd.DataFrame(liste)</span>

<span class="n">result</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;main_data&quot;</span><span class="p">:</span> <span class="n">main_data</span><span class="p">,</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../../../../home.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../api_key.html">Proxy Configuration</a></li>


<li class="toctree-l1"><a class="reference internal" href="../../../../get_series.html">get_series Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../get_series_exp.html">get_series_exp Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../setup.html">setup Function</a></li>
Expand All @@ -159,6 +162,7 @@
<li class="toctree-l1"><a class="reference internal" href="../../../../proxy.html">Proxy Configuration</a></li>


<li class="toctree-l1"><a class="reference internal" href="../../../../examples.html">Examples</a></li>
</ul>

</div>
Expand Down Expand Up @@ -649,14 +653,7 @@ <h1>Source code for evdspy.EVDSlocal.initial.load_commands_cmds_to_load</h1><div
<span class="n">print_with_success_style</span><span class="p">(</span><span class="s2">&quot;cahce folder removed...&quot;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">print_with_failure_style</span><span class="p">(</span><span class="s2">&quot;cahce folder coould not be removed...&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">testt_the_latest</span><span class="p">():</span>
<span class="n">get_all_groups</span><span class="p">()</span>
<span class="c1"># get_and_process_datagroups_with_code(3)</span>
<span class="c1"># def __():</span>
<span class="c1"># *coming, last = get_datagroups_df(&#39;json&#39;, None, True)</span>
<span class="c1"># print(coming)</span>
<span class="c1"># print(last)</span>
<span class="c1"># print(last())</span>

<span class="k">def</span> <span class="nf">main_exit_function</span><span class="p">():</span>
<span class="o">...</span>
<span class="k">def</span> <span class="nf">menu_display</span><span class="p">():</span>
Expand All @@ -678,8 +675,7 @@ <h1>Source code for evdspy.EVDSlocal.initial.load_commands_cmds_to_load</h1><div
<span class="p">(</span><span class="s2">&quot;py version&quot;</span><span class="p">,</span> <span class="n">py_version</span><span class="p">),</span>
<span class="p">(</span><span class="s2">&quot;check compatibility of your python version&quot;</span><span class="p">,</span> <span class="n">check_compat</span><span class="p">),</span>
<span class="p">]</span>
<span class="k">if</span> <span class="s1">&#39;NEXT_RELEASE&#39;</span> <span class="ow">in</span> <span class="nb">str</span><span class="p">(</span><span class="n">Path</span><span class="p">()</span><span class="o">.</span><span class="n">cwd</span><span class="p">()):</span>
<span class="n">funcs</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="s1">&#39;test_the latest&#39;</span><span class="p">,</span> <span class="n">testt_the_latest</span><span class="p">))</span>

<span class="n">menu_items</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">MenuItem</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> <span class="n">funcs</span><span class="p">))</span>
<span class="n">MenuMaker</span><span class="p">(</span>
<span class="n">menu_items</span><span class="o">=</span><span class="n">menu_items</span><span class="p">,</span>
Expand All @@ -691,6 +687,10 @@ <h1>Source code for evdspy.EVDSlocal.initial.load_commands_cmds_to_load</h1><div
<span class="k">global</span> <span class="n">menu_already_displayed</span>
<span class="n">menu_already_displayed</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">menu_display</span><span class="p">()</span>




<span class="k">def</span> <span class="nf">menu_onload</span><span class="p">():</span>
<span class="k">if</span> <span class="n">CurrentState</span><span class="p">()</span><span class="o">.</span><span class="n">menu_will_open</span><span class="p">:</span>
<span class="n">menu_helper</span><span class="p">()</span>
Expand Down
5 changes: 5 additions & 0 deletions docs/build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../home.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api_key.html">Proxy Configuration</a></li>


<li class="toctree-l1"><a class="reference internal" href="../get_series.html">get_series Function</a></li>

<li class="toctree-l1"><a class="reference internal" href="../get_series_exp.html">get_series_exp Function</a></li>

<li class="toctree-l1"><a class="reference internal" href="../setup.html">setup Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../save.html">save Function</a></li>
<li class="toctree-l1"><a class="reference internal" href="../menu.html">menu Function</a></li>
Expand Down
33 changes: 26 additions & 7 deletions docs/build/html/_sources/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,33 @@ 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())
from evdspy import get_series , get_series_exp
index = """
TP.DK.USD.A
TP.DK.EUR.A
TP.DK.CHF.A
TP.DK.GBP.A
TP.DK.JPY.A
"""
result = get_series_exp(index, start_date="01-01-2017", end_date="31-12-2017" )
print(result.data)
print(result.metadata)
Applying formulas and aggregation:
cache True for eficient requests. Only checks request result for the current day.

.. code-block:: python
template = "TP.ODEMGZS.BDTTOPLAM"
df = get_series(template, start_date="01-01-2020", formulas="level", aggregation="sum")
print(df.head())
from evdspy import get_series , get_series_exp
index = """
TP.DK.USD.A
TP.DK.EUR.A
TP.DK.CHF.A
TP.DK.GBP.A
TP.DK.JPY.A
"""
result = get_series_exp(index, cache = True , start_date="01-01-2017", end_date="31-12-2017" )
print(result.data)
49 changes: 45 additions & 4 deletions docs/build/html/_sources/get_series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,70 @@ Raises
ValueError
Raised if an invalid API key is provided or required parameters are missing.


Creating a `.env` File
=============

Create a `.env` file in the root directory of your project and define your proxies as shown below:


.. code-block:: bash
# Example .env file content
EVDS_API_KEY=AxByCzDsFoGmHeIgJaKrLbMaNgOe
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")
from evdspy import get_series
index = """
TP.DK.USD.A
TP.DK.EUR.A
TP.DK.CHF.A
TP.DK.GBP.A
TP.DK.JPY.A
"""
df = get_series(index, api_key ="ABCDEFGHIJKLM" )
print(df.head())
.. code-block:: python
from evdspy import get_series , get_series_exp , menu
index = ["TP.MEVDUAT.I006", "TP.MEVDUAT.I012"]
df = get_series(
index, start_date="01-01-2010", end_date="01-01-2020", frequency="monthly"
)
print(df.head())
Using multiple indexes and cache:

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

.. code-block:: python
template = "TP.ODEMGZS.BDTTOPLAM"
template = """
TP.KREDI.L002
TP.BFTUKKRE.L004
TP.BFTUKKRE.L056
TP.BFTUKKRE.L193
TP.BFTUKKRE.L234
"""
df = get_series(template, start_date="01-01-2020", formulas="level", aggregation="sum")
print(df.head())
Expand Down
Loading

0 comments on commit ebe6f4e

Please sign in to comment.