Skip to content

Commit

Permalink
Merge pull request #31 from SermetPekin/simple
Browse files Browse the repository at this point in the history
python 3.13
  • Loading branch information
SermetPekin authored Dec 11, 2024
2 parents 505a44b + 9d4b480 commit 26ab550
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 56 deletions.
22 changes: 0 additions & 22 deletions evdspy_tes_t.py

This file was deleted.

51 changes: 19 additions & 32 deletions example.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
import pandas as pd

from evdspy import get_series, get_series_exp
from evdspy import get_series, default_start_date_fnc, default_end_date_fnc
import pandas as pd
def get_api_key():
import os
return os.getenv("EVDS_API_KEY")

template = """TP_GSYIH01_GY_CF
TP_GSYIH02_GY_CF
TP_GSYIH03_GY_CF
TP_GSYIH04_GY_CF
TP_GSYIH05_GY_CF
TP_GSYIH06_GY_CF
TP_GSYIH07_GY_CF
TP_GSYIH08_GY_CF
TP_GSYIH09_GY_CF
TP_GSYIH10_GY_CF
TP_GSYIH11_GY_CF
TP_GSYIH14_GY_CF
TP_GSYIH15_GY_CF
TP_GSYIH16_GY_CF
"""
assert isinstance(get_api_key(), str) and len(get_api_key()) == 10

# pandas dataframe
df = get_series(template, cache=False)
print(df)

# Result Class instance
# .data : pd.DataFrame (data) e.g. result.data
# .metadata : pd.DataFrame (metadata) e.g. result.metadata
# .write() : Callable e.g. result.write("example.xlsx")
result = get_series_exp(template, cache=False)

print(result) # Result
print(result.data) # pd.DataFrame
print(result.metadata) # pd.DataFrame

result.write("example.xlsx")
def t1():
df = get_series("TP.ODEMGZS.BDTTOPLAM",
frequency="monthly",
start_date=default_start_date_fnc(),
end_date=default_end_date_fnc(),
aggregation=("avg",),
cache=False,
debug=False,
api_key=get_api_key())
print(df)
assert isinstance(df, pd.DataFrame)
if __name__ == "__main__":
t1()
37 changes: 35 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
from evdspy import menu
menu()
import pandas as pd

from evdspy import get_series, get_series_exp

template = """TP_GSYIH01_GY_CF
TP_GSYIH02_GY_CF
TP_GSYIH03_GY_CF
TP_GSYIH04_GY_CF
TP_GSYIH05_GY_CF
TP_GSYIH06_GY_CF
TP_GSYIH07_GY_CF
TP_GSYIH08_GY_CF
TP_GSYIH09_GY_CF
TP_GSYIH10_GY_CF
TP_GSYIH11_GY_CF
TP_GSYIH14_GY_CF
TP_GSYIH15_GY_CF
TP_GSYIH16_GY_CF
"""

# pandas dataframe
df = get_series(template, cache=False)
print(df)

# Result Class instance
# .data : pd.DataFrame (data) e.g. result.data
# .metadata : pd.DataFrame (metadata) e.g. result.metadata
# .write() : Callable e.g. result.write("example.xlsx")
result = get_series_exp(template, cache=False)

print(result) # Result
print(result.data) # pd.DataFrame
print(result.metadata) # pd.DataFrame

result.write("example.xlsx")
File renamed without changes.
2 changes: 2 additions & 0 deletions main_menu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from evdspy import menu
menu()

0 comments on commit 26ab550

Please sign in to comment.