-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch_viewer.py
More file actions
executable file
Β·57 lines (49 loc) Β· 1.81 KB
/
launch_viewer.py
File metadata and controls
executable file
Β·57 lines (49 loc) Β· 1.81 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
53
54
55
56
#!/usr/bin/env python3
"""
Launch script for the BrightData Snapshot Viewer
"""
import subprocess
import sys
import os
from pathlib import Path
def main():
print("π Launching BrightData Manager...")
print("=" * 50)
# Check if we're in the right directory
if not Path("data/snapshots").exists():
print("β data/snapshots directory not found!")
print("π‘ Make sure you're running this from the project root directory.")
print("π‘ The snapshots have been moved to data/snapshots/ during cleanup.")
return
# Check if streamlit is installed
try:
import streamlit
print("β
Streamlit is installed")
except ImportError:
print("β Streamlit not found. Installing requirements...")
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements_ui.txt"])
print("β
Requirements installed successfully")
except subprocess.CalledProcessError:
print("β Failed to install requirements")
return
# Launch the app
print("π Starting multi-page web interface...")
print("π± The app will open in your default browser")
print("π Press Ctrl+C to stop the server")
print()
print("π Available pages:")
print(" β’ Query Builder - Create and submit data queries")
print(" β’ Snapshot Viewer - View and analyze downloaded data")
print(" β’ Settings - Manage API credentials and configuration")
print()
try:
subprocess.run([
sys.executable, "-m", "streamlit", "run", "app.py",
"--server.port", "8501",
"--server.address", "localhost"
])
except KeyboardInterrupt:
print("\nπ BrightData Manager stopped")
if __name__ == "__main__":
main()