We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a31bfa1 commit b55d15bCopy full SHA for b55d15b
src/axiomatic/magic.py
@@ -12,15 +12,10 @@ class AXMagic:
12
"""Class implementing magic functions for IPython.
13
Import with `%load_ext axiomatic.magic`."""
14
15
- def __init__(self):
+ def __init__(self, api_key: str = os.getenv("AXIOMATIC_API_KEY")):
16
self.folder = platformdirs.user_config_dir("axiomatic")
17
- if not os.path.exists(f"{self.folder}/api_key"):
18
- os.makedirs(self.folder, exist_ok=True)
19
- self.api_key = None
20
- else:
21
- with open(f"{self.folder}/api_key", "r") as f:
22
- self.api_key = f.read()
23
- self.ax = Axiomatic(api_key=self.api_key)
+
+ self.api_key = api_key
24
self.query = ""
25
26
def ax_api(self, query):
0 commit comments