-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
52 lines (38 loc) · 1.52 KB
/
setup.py
File metadata and controls
52 lines (38 loc) · 1.52 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
"""
Setup script for Crypto Analysis Pro
This script helps you configure the application with your API keys.
"""
import os
import streamlit as st
def create_secrets_file():
"""Create the secrets.toml file with user input"""
print("🔧 Crypto Analysis Pro Setup")
print("=" * 40)
# Get API keys from user
coingecko_key = input("Enter your CoinGecko API key (or press Enter to skip): ").strip()
fred_key = input("Enter your FRED API key (or press Enter to skip): ").strip()
# Create .streamlit directory if it doesn't exist
os.makedirs(".streamlit", exist_ok=True)
# Create secrets.toml file
secrets_content = f"""# Streamlit Secrets Configuration
# Generated by setup.py
# CoinGecko API Key
COINGECKO_API_KEY = "{coingecko_key if coingecko_key else 'your_coingecko_api_key_here'}"
# FRED API Key
FRED_API_KEY = "{fred_key if fred_key else 'your_fred_api_key_here'}"
"""
with open(".streamlit/secrets.toml", "w") as f:
f.write(secrets_content)
print("\n✅ Configuration saved to .streamlit/secrets.toml")
if coingecko_key:
print("🔑 CoinGecko API key configured")
else:
print("⚠️ No CoinGecko API key provided - using free tier")
if fred_key:
print("🔑 FRED API key configured")
else:
print("⚠️ No FRED API key provided - economic data will be limited")
print("\n🚀 You can now run: streamlit run app.py")
if __name__ == "__main__":
create_secrets_file()