-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
30 lines (23 loc) · 933 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from dotenv import load_dotenv
import os
# Load environment variables from the .env file located in the .env folder
load_dotenv(dotenv_path='.env/.env') # Point to the new location of the .env file
# Access the API key and other environment variables
# Coinbase API
COINBASE_API_KEY = os.getenv('CDP_API_KEY')
BASE_URL = "https://api.coinbase.com/api/v3"
GOOGLE_CREDENTIALS_PATH = os.getenv('GOOGLE_CREDENTIALS_PATH')
# Google Sheets details
SHEET_ID = os.getenv('SHEET_ID')
SHEET_RANGE = "Sheet1!A1:D20"
# Headers for Coinbase API
HEADERS = {
'Authorization': f'Bearer {COINBASE_API_KEY}',
'Content-Type': 'application/json'
}
# === Validation of Environment Variables ===
if not COINBASE_API_KEY:
raise ValueError("Coinbase API key not found. Please check your .env file.")
if not SHEET_ID:
raise ValueError("Google Sheet ID not found. Please check your .env file.")
print("Authorization Header:", HEADERS)