Datasets:
Download source/tools/orkey.py from Syndicate604/science-desk: direct link, hf CLI and curl.
- Browser
- Download file 418 Bytes
-
https://huggingface.co/datasets/Syndicate604/science-desk/resolve/main/source/tools/orkey.py
- Command line
-
hf download hf://datasets/Syndicate604/science-desk/source/tools/orkey.py
-
curl -L -o orkey.py https://huggingface.co/datasets/Syndicate604/science-desk/resolve/main/source/tools/orkey.py
418 Bytes
| """Read API keys from the evidence-desk repo's .env inside the process. Never print them.""" | |
| import os | |
| import re | |
| ENV_FILE = os.path.join(os.path.dirname(__file__), "..", "..", ".env") | |
| def env_key(name: str) -> str: | |
| text = open(ENV_FILE).read() | |
| m = re.search(rf"^{name}=(.+)$", text, re.M) | |
| if not m: | |
| raise SystemExit(f"{name} not found in {ENV_FILE}") | |
| return m.group(1).strip().strip("'\"") | |