From 392e67e7634fdddf48770f4bca6e4cc10044dc18 Mon Sep 17 00:00:00 2001 From: "sermet.pekin" Date: Wed, 31 Jul 2024 17:27:15 +0300 Subject: [PATCH] dotenv path problem --- .gitignore | 3 + Example_get_series_exp.ipynb | 419 +++++++++++++++--- evdspy/EVDSlocal/config/apikey_class.py | 28 +- evdspy/EVDSlocal/config/dotenv.py | 26 ++ .../get_series_indexes_utils.py | 30 +- pyproject.toml | 2 +- 6 files changed, 432 insertions(+), 76 deletions(-) create mode 100644 evdspy/EVDSlocal/config/dotenv.py diff --git a/.gitignore b/.gitignore index 67a8902..82c744b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Byte-compiled / optimized / DLL files __pycache__/ +*Chat*/ +*chat* + SCRAT*/ scra*.py *.ipynb diff --git a/Example_get_series_exp.ipynb b/Example_get_series_exp.ipynb index f0a6680..be4a756 100644 --- a/Example_get_series_exp.ipynb +++ b/Example_get_series_exp.ipynb @@ -5,7 +5,16 @@ "execution_count": 1, "id": "08f96479-49fa-4e27-a33b-81bf55d8ad5a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "reading from [.env]\n", + "reading from [.env]\n" + ] + } + ], "source": [ "# !pip install python-dotenv \n", "from evdspy import get_series_exp" @@ -13,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "c0a19143-8a35-41b2-a860-b23e21c1e2aa", "metadata": {}, "outputs": [ @@ -22,18 +31,17 @@ "output_type": "stream", "text": [ " Checking ... TP.GSYIH02.GY.CF\n", - "\n", "\n" ] }, { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;31;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -92,20 +100,19 @@ "0 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", "\n", " APP_CHA_LINK_ENG START_DATE END_DATE \n", - "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x12a57fc40>)\n", + "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x13c4e7ce0>)\n", " Checking ... TP.GSYIH02.GY.CF\n", - "\n", "\n" ] }, { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;38;5;199;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;31;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -164,7 +171,7 @@ "0 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", "\n", " APP_CHA_LINK_ENG START_DATE END_DATE \n", - "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x12a57fd80>)\n", + "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x13c4e7c40>)\n", " Checking ... TP_GSYIH01_GY_CF\n", "TP_GSYIH02_GY_CF\n", "TP_GSYIH03_GY_CF\n", @@ -180,18 +187,17 @@ "TP_GSYIH15_GY_CF\n", "TP_GSYIH16_GY_CF\n", "\n", - "\n", "\n" ] }, { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;38;5;199;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -207,11 +213,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;31;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -227,11 +233,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;38;5;199;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;31;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -247,11 +253,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;38;5;199;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -287,11 +293,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;31;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -307,11 +313,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;31;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -327,11 +333,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -347,11 +353,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -367,11 +373,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -387,11 +393,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -407,11 +413,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;31;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;38;5;199;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -427,11 +433,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -447,11 +453,11 @@ { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -711,20 +717,19 @@ "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", - "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x12a5c13a0>)\n", + "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x13c7304a0>)\n", " Checking ... bie_gsyhgycf\n", - "\n", "\n" ] }, { "data": { "text/html": [ - "
Could not convert some columns to float type...\n",
+       "
Could not convert some columns to float type...\n",
        "
\n" ], "text/plain": [ - "\u001b[3;36;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" + "\u001b[3;35;40mCould not convert some columns to float type\u001b[0m\u001b[3;33;40m...\u001b[0m\n" ] }, "metadata": {}, @@ -1045,7 +1050,7 @@ "14 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", "15 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", "16 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", - "17 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x12a5c0cc0>)\n" + "17 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x1047b5300>)\n" ] } ], @@ -1078,7 +1083,7 @@ "def fnc(item: Any):\n", " print(f\" Checking ... {item}\")\n", " time.sleep(2)\n", - " df = get_series_exp(item, debug=False, cache=True)\n", + " df = get_series_exp(item, debug=False, cache=False)\n", " print(df)\n", " return df \n", "\n", @@ -1092,23 +1097,331 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 9, "id": "5e3186f8-9920-4041-ba49-677ed49184bb", "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "\"\\n ! get_series_exp function returns instance of this class \\n \\n data : pd.DataFrame => contains data [ same as what get_series function returns ] \\n metadata : pd.DataFrame => contains metadata if available \\n write : Callable => creates and Excel file with data and metadadata of two sheets \\n to_excel : Callable => same with write to meet pandas to_excel function \\n \\n Result(data= TP_GSYIH01_GY_CF TP_GSYIH02_GY_CF TP_GSYIH03_GY_CF TP_GSYIH04_GY_CF \\\\\\n0 6.106739e+04 2.484849e+06 2.099761e+06 5.566121e+05 \\n1 1.022063e+05 2.748397e+06 2.373615e+06 1.106882e+06 \\n2 1.277332e+05 3.020707e+06 2.601849e+06 1.258192e+06 \\n3 1.277646e+05 3.155493e+06 2.686372e+06 1.171740e+06 \\n4 8.015448e+04 3.260544e+06 2.704172e+06 6.152476e+05 \\n.. ... ... ... ... \\n92 1.141463e+07 4.268805e+08 3.940705e+08 8.363157e+07 \\n93 1.639448e+07 4.260205e+08 3.895592e+08 9.403154e+07 \\n94 2.517321e+07 5.450164e+08 4.976900e+08 1.340035e+08 \\n95 2.208713e+07 5.595067e+08 5.099294e+08 1.386888e+08 \\n96 2.251595e+07 8.163326e+08 7.506112e+08 1.863063e+08 \\n\\n TP_GSYIH05_GY_CF TP_GSYIH06_GY_CF TP_GSYIH07_GY_CF TP_GSYIH08_GY_CF \\\\\\n0 2.548026e+06 2.050418e+05 6.826649e+05 4.192956e+04 \\n1 2.811977e+06 2.274439e+05 7.417792e+05 4.270630e+04 \\n2 2.811540e+06 2.555880e+05 7.872546e+05 4.579670e+04 \\n3 3.024516e+06 3.033064e+05 8.912610e+05 4.923439e+04 \\n4 2.814495e+06 2.809577e+05 8.381537e+05 6.050674e+04 \\n.. ... ... ... ... \\n92 3.752743e+08 4.235482e+07 6.168964e+07 1.067667e+07 \\n93 4.039706e+08 4.714779e+07 6.261452e+07 1.088415e+07 \\n94 5.208236e+08 6.184329e+07 8.012384e+07 1.415563e+07 \\n95 5.260302e+08 6.522723e+07 8.694186e+07 1.397757e+07 \\n96 7.480911e+08 8.842872e+07 1.262525e+08 2.214702e+07 \\n\\n TP_GSYIH09_GY_CF TP_GSYIH10_GY_CF TP_GSYIH11_GY_CF TP_GSYIH14_GY_CF \\\\\\n0 3.019369e+05 2.645360e+06 2.136746e+05 9.741161e+06 \\n1 3.204776e+05 2.955066e+06 2.066519e+05 1.126359e+07 \\n2 3.439947e+05 3.156229e+06 2.344814e+05 1.204152e+07 \\n3 3.689445e+05 3.479821e+06 2.203650e+05 1.279245e+07 \\n4 3.982261e+05 3.546288e+06 2.828418e+05 1.217742e+07 \\n.. ... ... ... ... \\n92 1.044011e+08 4.157530e+08 3.465333e+07 1.566730e+09 \\n93 1.217885e+08 4.595721e+08 3.547861e+07 1.677903e+09 \\n94 1.524647e+08 6.046323e+08 4.909999e+07 2.187336e+09 \\n95 1.587377e+08 5.852262e+08 4.889545e+07 2.205319e+09 \\n96 2.202426e+08 9.594455e+08 7.559247e+07 3.265355e+09 \\n\\n TP_GSYIH15_GY_CF TP_GSYIH16_GY_CF TP_GSYIH17_GY_CF TP_GSYIH18_GY_CF \\\\\\n0 7.963676e+04 1.993898e+07 5.556330e+06 1.438265e+07 \\n1 8.152032e+04 2.508516e+07 6.373442e+06 1.871172e+07 \\n2 7.229579e+04 3.126156e+07 6.838204e+06 2.442336e+07 \\n3 5.963222e+04 3.122278e+07 7.227375e+06 2.399540e+07 \\n4 1.342008e+05 2.795945e+07 8.299806e+06 1.965965e+07 \\n.. ... ... ... ... \\n92 -8.786390e+07 2.664565e+09 1.008799e+09 1.655765e+09 \\n93 -5.181759e+07 3.269685e+09 1.119704e+09 2.149981e+09 \\n94 -5.788269e+07 4.666974e+09 1.452790e+09 3.214184e+09 \\n95 -1.155560e+08 5.327142e+09 1.584150e+09 3.742992e+09 \\n96 -1.645351e+08 4.679305e+09 1.238951e+09 3.440354e+09 \\n\\n TP_GSYIH19_GY_CF TP_GSYIH26_GY_CF Tarih \\n0 3.662041e+06 3.342182e+07 2000-Q1 \\n1 4.075028e+06 4.050529e+07 2000-Q2 \\n2 4.895470e+06 4.827084e+07 2000-Q3 \\n3 5.221395e+06 4.929625e+07 2000-Q4 \\n4 4.842235e+06 4.511330e+07 2001-Q1 \\n.. ... ... ... \\n92 4.987156e+08 4.642146e+09 2023-Q1 \\n93 6.104028e+08 5.506173e+09 2023-Q2 \\n94 9.001857e+08 7.696613e+09 2023-Q3 \\n95 1.014470e+09 8.431375e+09 2023-Q4 \\n96 1.042124e+09 8.822248e+09 2024-Q1 \\n\\n[97 rows x 19 columns], metadata= SERIE_CODE DATAGROUP_CODE \\\\\\n0 TP.GSYIH01.GY.CF bie_gsyhgycf \\n1 TP.GSYIH02.GY.CF bie_gsyhgycf \\n2 TP.GSYIH03.GY.CF bie_gsyhgycf \\n3 TP.GSYIH04.GY.CF bie_gsyhgycf \\n4 TP.GSYIH05.GY.CF bie_gsyhgycf \\n5 TP.GSYIH06.GY.CF bie_gsyhgycf \\n6 TP.GSYIH07.GY.CF bie_gsyhgycf \\n7 TP.GSYIH08.GY.CF bie_gsyhgycf \\n8 TP.GSYIH09.GY.CF bie_gsyhgycf \\n9 TP.GSYIH10.GY.CF bie_gsyhgycf \\n10 TP.GSYIH11.GY.CF bie_gsyhgycf \\n11 TP.GSYIH14.GY.CF bie_gsyhgycf \\n12 TP.GSYIH15.GY.CF bie_gsyhgycf \\n13 TP.GSYIH16.GY.CF bie_gsyhgycf \\n14 TP.GSYIH17.GY.CF bie_gsyhgycf \\n15 TP.GSYIH18.GY.CF bie_gsyhgycf \\n16 TP.GSYIH19.GY.CF bie_gsyhgycf \\n17 TP.GSYIH26.GY.CF bie_gsyhgycf \\n\\n SERIE_NAME \\\\\\n0 Tarım, ormancılık ve balıkçılık(Bin TL) \\n1 Sanayi(Bin TL) \\n2 İmalat sanayi(Bin TL) \\n3 İnşaat(Bin TL) \\n4 Hizmetler(Bin TL) \\n5 Bilgi ve iletişim(Bin TL) \\n6 Finans ve sigorta faaliyetleri(Bin TL) \\n7 Gayrimenkul faaliyetleri(Bin TL) \\n8 Mesleki, idari ve destek hizmet faaliyetleri(B... \\n9 Kamu yönetimi, eğitim, insan sağlığı ve sosyal... \\n10 Diğer hizmet faaliyetleri(Bin TL) \\n11 Toplam işgücü ödemeleri(Bin TL) \\n12 Üretim üzerindeki net vergiler(Bin TL) \\n13 Brüt işletme artığı/karma gelir(Bin TL) \\n14 Sabit sermaye tüketimi(Bin TL) \\n15 Net işletme artığı/karma gelir(Bin TL) \\n16 Ürün üzerindeki vergiler eksi sübvansiyonlar(B... \\n17 Gayrisafi Yurtiçi Hasıla (Alıcı fiyatlarıyla)(... \\n\\n SERIE_NAME_ENG FREQUENCY_STR \\\\\\n0 Agriculture, forestry and fishing(Thousand TL) ÜÇ AYLIK \\n1 Industry(Thousand TL) ÜÇ AYLIK \\n2 Manufacturing(Thousand TL) ÜÇ AYLIK \\n3 Construction(Thousand TL) ÜÇ AYLIK \\n4 Services(Thousand TL) ÜÇ AYLIK \\n5 Information and communication(Thousand TL) ÜÇ AYLIK \\n6 Financial and insurance activities(Thousand TL) ÜÇ AYLIK \\n7 Real estate activities(Thousand TL) ÜÇ AYLIK \\n8 Professional, administrative and support servi... ÜÇ AYLIK \\n9 Public administration, education, human health... ÜÇ AYLIK \\n10 Other service activities(Thousand TL) ÜÇ AYLIK \\n11 Total compensation of employees(Thousand TL) ÜÇ AYLIK \\n12 Net taxes on production(Thousand TL) ÜÇ AYLIK \\n13 Gross Operating surplus(Thousand TL) ÜÇ AYLIK \\n14 Consumption on fixed capital(Thousand TL) ÜÇ AYLIK \\n15 Net operating surplus(Thousand TL) ÜÇ AYLIK \\n16 Taxes less subsidies on products(Thousand TL) ÜÇ AYLIK \\n17 Gross Domestic Product (Purchaser's Price)(Tho... ÜÇ AYLIK \\n\\n DEFAULT_AGG_METHOD_STR DEFAULT_AGG_METHOD \\\\\\n0 KÜMÜLATİF sum \\n1 KÜMÜLATİF sum \\n2 KÜMÜLATİF sum \\n3 KÜMÜLATİF sum \\n4 KÜMÜLATİF sum \\n5 KÜMÜLATİF sum \\n6 KÜMÜLATİF sum \\n7 KÜMÜLATİF sum \\n8 KÜMÜLATİF sum \\n9 KÜMÜLATİF sum \\n10 KÜMÜLATİF sum \\n11 KÜMÜLATİF sum \\n12 KÜMÜLATİF sum \\n13 KÜMÜLATİF sum \\n14 KÜMÜLATİF sum \\n15 KÜMÜLATİF sum \\n16 KÜMÜLATİF sum \\n17 KÜMÜLATİF sum \\n\\n TAG TAG_ENG \\\\\\n0 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n1 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n2 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n3 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n4 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n5 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n6 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n7 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n8 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n9 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n10 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n11 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n12 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n13 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n14 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n15 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n16 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n17 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \\n\\n DATASOURCE DATASOURCE_ENG \\\\\\n0 TÜİK TURKSTAT \\n1 TÜİK TURKSTAT \\n2 TÜİK TURKSTAT \\n3 TÜİK TURKSTAT \\n4 TÜİK TURKSTAT \\n5 TÜİK TURKSTAT \\n6 TÜİK TURKSTAT \\n7 TÜİK TURKSTAT \\n8 TÜİK TURKSTAT \\n9 TÜİK TURKSTAT \\n10 TÜİK TURKSTAT \\n11 TÜİK TURKSTAT \\n12 TÜİK TURKSTAT \\n13 TÜİK TURKSTAT \\n14 TÜİK TURKSTAT \\n15 TÜİK TURKSTAT \\n16 TÜİK TURKSTAT \\n17 TÜİK TURKSTAT \\n\\n METADATA_LINK \\\\\\n0 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n1 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n2 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n3 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n4 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n5 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n6 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n7 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n8 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n9 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n10 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n11 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n12 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n13 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n14 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n15 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n16 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n17 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n\\n METADATA_LINK_ENG \\\\\\n0 https://data.tuik.gov.tr/Search/Search?text=In... \\n1 https://data.tuik.gov.tr/Search/Search?text=In... \\n2 https://data.tuik.gov.tr/Search/Search?text=In... \\n3 https://data.tuik.gov.tr/Search/Search?text=In... \\n4 https://data.tuik.gov.tr/Search/Search?text=In... \\n5 https://data.tuik.gov.tr/Search/Search?text=In... \\n6 https://data.tuik.gov.tr/Search/Search?text=In... \\n7 https://data.tuik.gov.tr/Search/Search?text=In... \\n8 https://data.tuik.gov.tr/Search/Search?text=In... \\n9 https://data.tuik.gov.tr/Search/Search?text=In... \\n10 https://data.tuik.gov.tr/Search/Search?text=In... \\n11 https://data.tuik.gov.tr/Search/Search?text=In... \\n12 https://data.tuik.gov.tr/Search/Search?text=In... \\n13 https://data.tuik.gov.tr/Search/Search?text=In... \\n14 https://data.tuik.gov.tr/Search/Search?text=In... \\n15 https://data.tuik.gov.tr/Search/Search?text=In... \\n16 https://data.tuik.gov.tr/Search/Search?text=In... \\n17 https://data.tuik.gov.tr/Search/Search?text=In... \\n\\n REV_POL_LINK \\\\\\n0 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n1 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n2 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n3 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n4 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n5 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n6 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n7 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n8 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n9 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n10 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n11 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n12 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n13 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n14 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n15 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n16 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n17 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n\\n REV_POL_LINK_ENG \\\\\\n0 https://data.tuik.gov.tr/Search/Search?text=In... \\n1 https://data.tuik.gov.tr/Search/Search?text=In... \\n2 https://data.tuik.gov.tr/Search/Search?text=In... \\n3 https://data.tuik.gov.tr/Search/Search?text=In... \\n4 https://data.tuik.gov.tr/Search/Search?text=In... \\n5 https://data.tuik.gov.tr/Search/Search?text=In... \\n6 https://data.tuik.gov.tr/Search/Search?text=In... \\n7 https://data.tuik.gov.tr/Search/Search?text=In... \\n8 https://data.tuik.gov.tr/Search/Search?text=In... \\n9 https://data.tuik.gov.tr/Search/Search?text=In... \\n10 https://data.tuik.gov.tr/Search/Search?text=In... \\n11 https://data.tuik.gov.tr/Search/Search?text=In... \\n12 https://data.tuik.gov.tr/Search/Search?text=In... \\n13 https://data.tuik.gov.tr/Search/Search?text=In... \\n14 https://data.tuik.gov.tr/Search/Search?text=In... \\n15 https://data.tuik.gov.tr/Search/Search?text=In... \\n16 https://data.tuik.gov.tr/Search/Search?text=In... \\n17 https://data.tuik.gov.tr/Search/Search?text=In... \\n\\n APP_CHA_LINK \\\\\\n0 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n1 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n2 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n3 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n4 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n5 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n6 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n7 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n8 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n9 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n10 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n11 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n12 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n13 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n14 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n15 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n16 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n17 https://data.tuik.gov.tr/Search/Search?text=Ge... \\n\\n APP_CHA_LINK_ENG START_DATE END_DATE \\n0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n1 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n2 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n3 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n4 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n5 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n6 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n7 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n8 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n9 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n10 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n11 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n12 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n13 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n14 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n15 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n16 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \\n17 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x12a5c0cc0>)\"" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " ! get_series_exp function returns instance of this class \n", + " \n", + " data : pd.DataFrame => contains data [ same as what get_series function returns ] \n", + " metadata : pd.DataFrame => contains metadata if available \n", + " write : Callable => creates and Excel file with data and metadadata of two sheets \n", + " to_excel : Callable => same with write to meet pandas to_excel function \n", + " \n", + " Result(data= TP_GSYIH01_GY_CF TP_GSYIH02_GY_CF TP_GSYIH03_GY_CF TP_GSYIH04_GY_CF \\\n", + "0 6.106739e+04 2.484849e+06 2.099761e+06 5.566121e+05 \n", + "1 1.022063e+05 2.748397e+06 2.373615e+06 1.106882e+06 \n", + "2 1.277332e+05 3.020707e+06 2.601849e+06 1.258192e+06 \n", + "3 1.277646e+05 3.155493e+06 2.686372e+06 1.171740e+06 \n", + "4 8.015448e+04 3.260544e+06 2.704172e+06 6.152476e+05 \n", + ".. ... ... ... ... \n", + "92 1.141463e+07 4.268805e+08 3.940705e+08 8.363157e+07 \n", + "93 1.639448e+07 4.260205e+08 3.895592e+08 9.403154e+07 \n", + "94 2.517321e+07 5.450164e+08 4.976900e+08 1.340035e+08 \n", + "95 2.208713e+07 5.595067e+08 5.099294e+08 1.386888e+08 \n", + "96 2.251595e+07 8.163326e+08 7.506112e+08 1.863063e+08 \n", + "\n", + " TP_GSYIH05_GY_CF TP_GSYIH06_GY_CF TP_GSYIH07_GY_CF TP_GSYIH08_GY_CF \\\n", + "0 2.548026e+06 2.050418e+05 6.826649e+05 4.192956e+04 \n", + "1 2.811977e+06 2.274439e+05 7.417792e+05 4.270630e+04 \n", + "2 2.811540e+06 2.555880e+05 7.872546e+05 4.579670e+04 \n", + "3 3.024516e+06 3.033064e+05 8.912610e+05 4.923439e+04 \n", + "4 2.814495e+06 2.809577e+05 8.381537e+05 6.050674e+04 \n", + ".. ... ... ... ... \n", + "92 3.752743e+08 4.235482e+07 6.168964e+07 1.067667e+07 \n", + "93 4.039706e+08 4.714779e+07 6.261452e+07 1.088415e+07 \n", + "94 5.208236e+08 6.184329e+07 8.012384e+07 1.415563e+07 \n", + "95 5.260302e+08 6.522723e+07 8.694186e+07 1.397757e+07 \n", + "96 7.480911e+08 8.842872e+07 1.262525e+08 2.214702e+07 \n", + "\n", + " TP_GSYIH09_GY_CF TP_GSYIH10_GY_CF TP_GSYIH11_GY_CF TP_GSYIH14_GY_CF \\\n", + "0 3.019369e+05 2.645360e+06 2.136746e+05 9.741161e+06 \n", + "1 3.204776e+05 2.955066e+06 2.066519e+05 1.126359e+07 \n", + "2 3.439947e+05 3.156229e+06 2.344814e+05 1.204152e+07 \n", + "3 3.689445e+05 3.479821e+06 2.203650e+05 1.279245e+07 \n", + "4 3.982261e+05 3.546288e+06 2.828418e+05 1.217742e+07 \n", + ".. ... ... ... ... \n", + "92 1.044011e+08 4.157530e+08 3.465333e+07 1.566730e+09 \n", + "93 1.217885e+08 4.595721e+08 3.547861e+07 1.677903e+09 \n", + "94 1.524647e+08 6.046323e+08 4.909999e+07 2.187336e+09 \n", + "95 1.587377e+08 5.852262e+08 4.889545e+07 2.205319e+09 \n", + "96 2.202426e+08 9.594455e+08 7.559247e+07 3.265355e+09 \n", + "\n", + " TP_GSYIH15_GY_CF TP_GSYIH16_GY_CF TP_GSYIH17_GY_CF TP_GSYIH18_GY_CF \\\n", + "0 7.963676e+04 1.993898e+07 5.556330e+06 1.438265e+07 \n", + "1 8.152032e+04 2.508516e+07 6.373442e+06 1.871172e+07 \n", + "2 7.229579e+04 3.126156e+07 6.838204e+06 2.442336e+07 \n", + "3 5.963222e+04 3.122278e+07 7.227375e+06 2.399540e+07 \n", + "4 1.342008e+05 2.795945e+07 8.299806e+06 1.965965e+07 \n", + ".. ... ... ... ... \n", + "92 -8.786390e+07 2.664565e+09 1.008799e+09 1.655765e+09 \n", + "93 -5.181759e+07 3.269685e+09 1.119704e+09 2.149981e+09 \n", + "94 -5.788269e+07 4.666974e+09 1.452790e+09 3.214184e+09 \n", + "95 -1.155560e+08 5.327142e+09 1.584150e+09 3.742992e+09 \n", + "96 -1.645351e+08 4.679305e+09 1.238951e+09 3.440354e+09 \n", + "\n", + " TP_GSYIH19_GY_CF TP_GSYIH26_GY_CF Tarih \n", + "0 3.662041e+06 3.342182e+07 2000-Q1 \n", + "1 4.075028e+06 4.050529e+07 2000-Q2 \n", + "2 4.895470e+06 4.827084e+07 2000-Q3 \n", + "3 5.221395e+06 4.929625e+07 2000-Q4 \n", + "4 4.842235e+06 4.511330e+07 2001-Q1 \n", + ".. ... ... ... \n", + "92 4.987156e+08 4.642146e+09 2023-Q1 \n", + "93 6.104028e+08 5.506173e+09 2023-Q2 \n", + "94 9.001857e+08 7.696613e+09 2023-Q3 \n", + "95 1.014470e+09 8.431375e+09 2023-Q4 \n", + "96 1.042124e+09 8.822248e+09 2024-Q1 \n", + "\n", + "[97 rows x 19 columns], metadata= SERIE_CODE DATAGROUP_CODE \\\n", + "0 TP.GSYIH01.GY.CF bie_gsyhgycf \n", + "1 TP.GSYIH02.GY.CF bie_gsyhgycf \n", + "2 TP.GSYIH03.GY.CF bie_gsyhgycf \n", + "3 TP.GSYIH04.GY.CF bie_gsyhgycf \n", + "4 TP.GSYIH05.GY.CF bie_gsyhgycf \n", + "5 TP.GSYIH06.GY.CF bie_gsyhgycf \n", + "6 TP.GSYIH07.GY.CF bie_gsyhgycf \n", + "7 TP.GSYIH08.GY.CF bie_gsyhgycf \n", + "8 TP.GSYIH09.GY.CF bie_gsyhgycf \n", + "9 TP.GSYIH10.GY.CF bie_gsyhgycf \n", + "10 TP.GSYIH11.GY.CF bie_gsyhgycf \n", + "11 TP.GSYIH14.GY.CF bie_gsyhgycf \n", + "12 TP.GSYIH15.GY.CF bie_gsyhgycf \n", + "13 TP.GSYIH16.GY.CF bie_gsyhgycf \n", + "14 TP.GSYIH17.GY.CF bie_gsyhgycf \n", + "15 TP.GSYIH18.GY.CF bie_gsyhgycf \n", + "16 TP.GSYIH19.GY.CF bie_gsyhgycf \n", + "17 TP.GSYIH26.GY.CF bie_gsyhgycf \n", + "\n", + " SERIE_NAME \\\n", + "0 Tarım, ormancılık ve balıkçılık(Bin TL) \n", + "1 Sanayi(Bin TL) \n", + "2 İmalat sanayi(Bin TL) \n", + "3 İnşaat(Bin TL) \n", + "4 Hizmetler(Bin TL) \n", + "5 Bilgi ve iletişim(Bin TL) \n", + "6 Finans ve sigorta faaliyetleri(Bin TL) \n", + "7 Gayrimenkul faaliyetleri(Bin TL) \n", + "8 Mesleki, idari ve destek hizmet faaliyetleri(B... \n", + "9 Kamu yönetimi, eğitim, insan sağlığı ve sosyal... \n", + "10 Diğer hizmet faaliyetleri(Bin TL) \n", + "11 Toplam işgücü ödemeleri(Bin TL) \n", + "12 Üretim üzerindeki net vergiler(Bin TL) \n", + "13 Brüt işletme artığı/karma gelir(Bin TL) \n", + "14 Sabit sermaye tüketimi(Bin TL) \n", + "15 Net işletme artığı/karma gelir(Bin TL) \n", + "16 Ürün üzerindeki vergiler eksi sübvansiyonlar(B... \n", + "17 Gayrisafi Yurtiçi Hasıla (Alıcı fiyatlarıyla)(... \n", + "\n", + " SERIE_NAME_ENG FREQUENCY_STR \\\n", + "0 Agriculture, forestry and fishing(Thousand TL) ÜÇ AYLIK \n", + "1 Industry(Thousand TL) ÜÇ AYLIK \n", + "2 Manufacturing(Thousand TL) ÜÇ AYLIK \n", + "3 Construction(Thousand TL) ÜÇ AYLIK \n", + "4 Services(Thousand TL) ÜÇ AYLIK \n", + "5 Information and communication(Thousand TL) ÜÇ AYLIK \n", + "6 Financial and insurance activities(Thousand TL) ÜÇ AYLIK \n", + "7 Real estate activities(Thousand TL) ÜÇ AYLIK \n", + "8 Professional, administrative and support servi... ÜÇ AYLIK \n", + "9 Public administration, education, human health... ÜÇ AYLIK \n", + "10 Other service activities(Thousand TL) ÜÇ AYLIK \n", + "11 Total compensation of employees(Thousand TL) ÜÇ AYLIK \n", + "12 Net taxes on production(Thousand TL) ÜÇ AYLIK \n", + "13 Gross Operating surplus(Thousand TL) ÜÇ AYLIK \n", + "14 Consumption on fixed capital(Thousand TL) ÜÇ AYLIK \n", + "15 Net operating surplus(Thousand TL) ÜÇ AYLIK \n", + "16 Taxes less subsidies on products(Thousand TL) ÜÇ AYLIK \n", + "17 Gross Domestic Product (Purchaser's Price)(Tho... ÜÇ AYLIK \n", + "\n", + " DEFAULT_AGG_METHOD_STR DEFAULT_AGG_METHOD \\\n", + "0 KÜMÜLATİF sum \n", + "1 KÜMÜLATİF sum \n", + "2 KÜMÜLATİF sum \n", + "3 KÜMÜLATİF sum \n", + "4 KÜMÜLATİF sum \n", + "5 KÜMÜLATİF sum \n", + "6 KÜMÜLATİF sum \n", + "7 KÜMÜLATİF sum \n", + "8 KÜMÜLATİF sum \n", + "9 KÜMÜLATİF sum \n", + "10 KÜMÜLATİF sum \n", + "11 KÜMÜLATİF sum \n", + "12 KÜMÜLATİF sum \n", + "13 KÜMÜLATİF sum \n", + "14 KÜMÜLATİF sum \n", + "15 KÜMÜLATİF sum \n", + "16 KÜMÜLATİF sum \n", + "17 KÜMÜLATİF sum \n", + "\n", + " TAG TAG_ENG \\\n", + "0 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "1 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "2 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "3 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "4 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "5 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "6 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "7 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "8 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "9 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "10 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "11 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "12 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "13 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "14 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "15 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "16 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "17 GSYİH, Gayri, Safi, Yurtiçi, Hasıla GDP, Gross, Domestic, Product \n", + "\n", + " DATASOURCE DATASOURCE_ENG \\\n", + "0 TÜİK TURKSTAT \n", + "1 TÜİK TURKSTAT \n", + "2 TÜİK TURKSTAT \n", + "3 TÜİK TURKSTAT \n", + "4 TÜİK TURKSTAT \n", + "5 TÜİK TURKSTAT \n", + "6 TÜİK TURKSTAT \n", + "7 TÜİK TURKSTAT \n", + "8 TÜİK TURKSTAT \n", + "9 TÜİK TURKSTAT \n", + "10 TÜİK TURKSTAT \n", + "11 TÜİK TURKSTAT \n", + "12 TÜİK TURKSTAT \n", + "13 TÜİK TURKSTAT \n", + "14 TÜİK TURKSTAT \n", + "15 TÜİK TURKSTAT \n", + "16 TÜİK TURKSTAT \n", + "17 TÜİK TURKSTAT \n", + "\n", + " METADATA_LINK \\\n", + "0 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "1 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "2 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "3 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "4 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "5 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "6 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "7 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "8 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "9 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "10 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "11 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "12 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "13 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "14 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "15 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "16 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "17 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "\n", + " METADATA_LINK_ENG \\\n", + "0 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "1 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "2 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "3 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "4 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "5 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "6 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "7 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "8 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "9 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "10 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "11 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "12 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "13 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "14 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "15 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "16 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "17 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "\n", + " REV_POL_LINK \\\n", + "0 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "1 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "2 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "3 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "4 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "5 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "6 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "7 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "8 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "9 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "10 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "11 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "12 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "13 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "14 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "15 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "16 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "17 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "\n", + " REV_POL_LINK_ENG \\\n", + "0 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "1 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "2 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "3 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "4 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "5 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "6 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "7 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "8 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "9 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "10 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "11 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "12 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "13 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "14 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "15 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "16 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "17 https://data.tuik.gov.tr/Search/Search?text=In... \n", + "\n", + " APP_CHA_LINK \\\n", + "0 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "1 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "2 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "3 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "4 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "5 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "6 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "7 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "8 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "9 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "10 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "11 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "12 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "13 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "14 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "15 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "16 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "17 https://data.tuik.gov.tr/Search/Search?text=Ge... \n", + "\n", + " APP_CHA_LINK_ENG START_DATE END_DATE \n", + "0 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "1 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "2 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "3 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "4 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "5 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "6 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "7 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "8 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "9 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "10 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "11 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "12 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "13 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "14 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "15 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "16 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 \n", + "17 https://data.tuik.gov.tr/Search/Search?text=In... 01-01-1998 01-01-2024 , write=.build_df at 0x12a5c0cc0>)\n" + ] } ], "source": [ - "str(result)" + "print(result)" ] }, { diff --git a/evdspy/EVDSlocal/config/apikey_class.py b/evdspy/EVDSlocal/config/apikey_class.py index b5de302..cbff5b5 100644 --- a/evdspy/EVDSlocal/config/apikey_class.py +++ b/evdspy/EVDSlocal/config/apikey_class.py @@ -1,3 +1,4 @@ +from .dotenv import load_env from ..common.common_imports import * from dataclasses import dataclass from typing import Union @@ -5,21 +6,26 @@ import os import traceback -try : - - from dotenv import load_dotenv - load_dotenv() -except Exception: - - print("""[solution] - $ pip install python-dotenv - """) - traceback.print_exc() - raise ModuleNotFoundError() +# try : +# +# from dotenv import load_dotenv +# load_dotenv() +# except Exception: +# +# print("""[solution] +# $ pip install python-dotenv +# """) +# traceback.print_exc() +# raise ModuleNotFoundError() from ..config.config import config from ..messages.error_classes import ApiKeyNotSetError +""" + ========================== load_env ========================== +""" +load_env() + diff --git a/evdspy/EVDSlocal/config/dotenv.py b/evdspy/EVDSlocal/config/dotenv.py new file mode 100644 index 0000000..fc1ebc6 --- /dev/null +++ b/evdspy/EVDSlocal/config/dotenv.py @@ -0,0 +1,26 @@ +import os +import traceback + +# from dotenv import load_dotenv +from pathlib import Path + +try: + + from dotenv import load_dotenv + + + def load_env(verbose=True): + """Load environment variables from a .env file in the current directory.""" + dotenv_path = Path(".") / '.env' + if verbose: + print(f"reading apikey from [{dotenv_path}]") + load_dotenv(dotenv_path) + +except Exception: + + print("""[solution] + $ pip install python-dotenv + """) + traceback.print_exc() + + raise ModuleNotFoundError() diff --git a/evdspy/EVDSlocal/index_requests/get_series_indexes_utils.py b/evdspy/EVDSlocal/index_requests/get_series_indexes_utils.py index d566320..c83eeeb 100644 --- a/evdspy/EVDSlocal/index_requests/get_series_indexes_utils.py +++ b/evdspy/EVDSlocal/index_requests/get_series_indexes_utils.py @@ -4,17 +4,25 @@ import traceback -try : - - from dotenv import load_dotenv - load_dotenv() -except Exception: - - print("""[solution] - $ pip install python-dotenv - """) - traceback.print_exc() - raise ModuleNotFoundError() +from evdspy.EVDSlocal.config.dotenv import load_env +# +# try : +# +# from dotenv import load_dotenv +# load_dotenv() +# except Exception: +# +# print("""[solution] +# $ pip install python-dotenv +# """) +# traceback.print_exc() +# raise ModuleNotFoundError() + + +""" + ========================== load_env ========================== +""" +load_env() def check_env(key_name: str, default_=None): diff --git a/pyproject.toml b/pyproject.toml index 5714f7a..f85a9b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ [tool.poetry] name = "evdspy" -version = "1.1.34" +version = "1.1.35" description = "A versatile interface for the 'EDDS' (EVDS) API of the Central Bank of the Republic of Türkiye (https://evds2.tcmb.gov.tr/index.php?/evds/userDocs). This package allows users to easily access and manage economic data through a user-friendly menu function. It features a robust caching mechanism to enhance the efficiency of data requests by storing frequently accessed data for selected periods. Required API keys can be obtained by registering on the EVDS website." authors = ["Sermet Pekin "] license = "MIT"