From d898f73731be968fe6b8505ca5d4c962314d3d2b Mon Sep 17 00:00:00 2001 From: Sermet Pekin Date: Wed, 17 Apr 2024 05:59:31 +0300 Subject: [PATCH] raise env --- evdspy_test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/evdspy_test.py b/evdspy_test.py index 9fbd30a..5918db4 100644 --- a/evdspy_test.py +++ b/evdspy_test.py @@ -8,11 +8,15 @@ def get_api_key(): return os.getenv("EVDS_API_KEY") +if not get_api_key(): + raise Exception("No API key provided from environment variables") + def test1(): setup() save(get_api_key()) + def test2(): df = get_series("TP.ODEMGZS.BDTTOPLAM", frequency="monthly", @@ -28,4 +32,4 @@ def test2(): if __name__ == "__main__": test1() - test2() \ No newline at end of file + test2()