32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
"""
|
|
Configuration module for BrighterTrading - EXAMPLE TEMPLATE.
|
|
|
|
Copy this file to config.py and either:
|
|
1. Set the environment variables below, OR
|
|
2. Directly assign your keys (NOT recommended for production)
|
|
|
|
Environment variables:
|
|
BRIGHTER_BINANCE_API_KEY
|
|
BRIGHTER_BINANCE_API_SECRET
|
|
BRIGHTER_ALPACA_API_KEY
|
|
BRIGHTER_ALPACA_API_SECRET
|
|
"""
|
|
import os
|
|
from pathlib import Path
|
|
|
|
# API Keys - loaded from environment variables
|
|
# To set environment variables:
|
|
# Linux/Mac: export BRIGHTER_BINANCE_API_KEY="your_key_here"
|
|
# Windows: set BRIGHTER_BINANCE_API_KEY=your_key_here
|
|
BINANCE_API_KEY = os.environ.get('BRIGHTER_BINANCE_API_KEY', '')
|
|
BINANCE_API_SECRET = os.environ.get('BRIGHTER_BINANCE_API_SECRET', '')
|
|
ALPACA_API_KEY = os.environ.get('BRIGHTER_ALPACA_API_KEY', '')
|
|
ALPACA_API_SECRET = os.environ.get('BRIGHTER_ALPACA_API_SECRET', '')
|
|
|
|
# Database path - cross-platform, relative to project root
|
|
_project_root = Path(__file__).parent.parent
|
|
DB_FILE = str(_project_root / 'data' / 'BrighterTrading.db')
|
|
|
|
# Ensure data directory exists
|
|
os.makedirs(os.path.dirname(DB_FILE), exist_ok=True)
|