Spaces:
Sleeping
Sleeping
Download utilities/api_keys.py from kimadams/BuildPlay: direct link, hf CLI and curl.
- Browser
- Download file 308 Bytes
-
https://huggingface.co/spaces/kimadams/BuildPlay/resolve/main/utilities/api_keys.py
- Command line
-
hf download hf://spaces/kimadams/BuildPlay/utilities/api_keys.py
-
curl -L -o api_keys.py https://huggingface.co/spaces/kimadams/BuildPlay/resolve/main/utilities/api_keys.py
308 Bytes
| import os | |
| from dotenv import load_dotenv | |
| class APIKeys: | |
| def __init__(self): | |
| load_dotenv() | |
| def get_key(self, key_name): | |
| key = os.getenv(key_name) | |
| if key: | |
| return key | |
| else: | |
| print(f'No value found for {key_name}') | |
| return None | |