File tree Expand file tree Collapse file tree 5 files changed +56
-56
lines changed Expand file tree Collapse file tree 5 files changed +56
-56
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import pandas as pd
2
1
3
- from evdspy import get_series , get_series_exp
2
+ from evdspy import get_series , default_start_date_fnc , default_end_date_fnc
3
+ import pandas as pd
4
+ def get_api_key ():
5
+ import os
6
+ return os .getenv ("EVDS_API_KEY" )
4
7
5
- template = """TP_GSYIH01_GY_CF
6
- TP_GSYIH02_GY_CF
7
- TP_GSYIH03_GY_CF
8
- TP_GSYIH04_GY_CF
9
- TP_GSYIH05_GY_CF
10
- TP_GSYIH06_GY_CF
11
- TP_GSYIH07_GY_CF
12
- TP_GSYIH08_GY_CF
13
- TP_GSYIH09_GY_CF
14
- TP_GSYIH10_GY_CF
15
- TP_GSYIH11_GY_CF
16
- TP_GSYIH14_GY_CF
17
- TP_GSYIH15_GY_CF
18
- TP_GSYIH16_GY_CF
19
- """
8
+ assert isinstance (get_api_key (), str ) and len (get_api_key ()) == 10
20
9
21
- # pandas dataframe
22
- df = get_series (template , cache = False )
23
- print (df )
24
-
25
- # Result Class instance
26
- # .data : pd.DataFrame (data) e.g. result.data
27
- # .metadata : pd.DataFrame (metadata) e.g. result.metadata
28
- # .write() : Callable e.g. result.write("example.xlsx")
29
- result = get_series_exp (template , cache = False )
30
-
31
- print (result ) # Result
32
- print (result .data ) # pd.DataFrame
33
- print (result .metadata ) # pd.DataFrame
34
-
35
- result .write ("example.xlsx" )
10
+ def t1 ():
11
+ df = get_series ("TP.ODEMGZS.BDTTOPLAM" ,
12
+ frequency = "monthly" ,
13
+ start_date = default_start_date_fnc (),
14
+ end_date = default_end_date_fnc (),
15
+ aggregation = ("avg" ,),
16
+ cache = False ,
17
+ debug = False ,
18
+ api_key = get_api_key ())
19
+ print (df )
20
+ assert isinstance (df , pd .DataFrame )
21
+ if __name__ == "__main__" :
22
+ t1 ()
Original file line number Diff line number Diff line change 1
- from evdspy import menu
2
- menu ()
1
+ import pandas as pd
2
+
3
+ from evdspy import get_series , get_series_exp
4
+
5
+ template = """TP_GSYIH01_GY_CF
6
+ TP_GSYIH02_GY_CF
7
+ TP_GSYIH03_GY_CF
8
+ TP_GSYIH04_GY_CF
9
+ TP_GSYIH05_GY_CF
10
+ TP_GSYIH06_GY_CF
11
+ TP_GSYIH07_GY_CF
12
+ TP_GSYIH08_GY_CF
13
+ TP_GSYIH09_GY_CF
14
+ TP_GSYIH10_GY_CF
15
+ TP_GSYIH11_GY_CF
16
+ TP_GSYIH14_GY_CF
17
+ TP_GSYIH15_GY_CF
18
+ TP_GSYIH16_GY_CF
19
+ """
20
+
21
+ # pandas dataframe
22
+ df = get_series (template , cache = False )
23
+ print (df )
24
+
25
+ # Result Class instance
26
+ # .data : pd.DataFrame (data) e.g. result.data
27
+ # .metadata : pd.DataFrame (metadata) e.g. result.metadata
28
+ # .write() : Callable e.g. result.write("example.xlsx")
29
+ result = get_series_exp (template , cache = False )
30
+
31
+ print (result ) # Result
32
+ print (result .data ) # pd.DataFrame
33
+ print (result .metadata ) # pd.DataFrame
34
+
35
+ result .write ("example.xlsx" )
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ from evdspy import menu
2
+ menu ()
You can’t perform that action at this time.
0 commit comments