-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
91 lines (73 loc) · 2.16 KB
/
setup.py
File metadata and controls
91 lines (73 loc) · 2.16 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"""
MediAlert Project Setup Script
This script prepares the project environment:
- Creates necessary directories
- Checks dependencies
- Initializes database
- Validates configuration
AI Attribution: Code generated with assistance from Claude AI (Anthropic)
via Cursor IDE on February 2026.
Usage:
python setup.py
"""
import os
import sys
from pathlib import Path
def create_directories():
"""Create project directory structure."""
dirs = [
'data/raw',
'data/processed',
'data/outputs',
'models',
'notebooks',
'scripts',
'uploads'
]
for dir_path in dirs:
Path(dir_path).mkdir(parents=True, exist_ok=True)
print("✓ Created directory structure")
def check_dependencies():
"""Check if required packages are installed."""
required = ['flask', 'requests', 'supabase']
missing = []
for package in required:
try:
__import__(package)
except ImportError:
missing.append(package)
if missing:
print(f"✗ Missing dependencies: {', '.join(missing)}")
print("Please run: pip install -r requirements.txt")
return False
print("✓ All core dependencies are installed")
return True
def check_env():
"""Check for .env configuration."""
if not os.path.exists('.env'):
print("⚠ Warning: .env file not found")
print("Copy .env.example to .env and fill in your credentials")
return False
print("✓ Found .env configuration")
return True
def main():
print("=" * 60)
print("MediAlert Project Setup")
print("=" * 60)
create_directories()
deps_ok = check_dependencies()
env_ok = check_env()
if not deps_ok:
sys.exit(1)
if not env_ok:
print("\n⚠ Configuration incomplete. Please create .env file.")
sys.exit(1)
print("\n" + "=" * 60)
print("Setup complete!")
print("=" * 60)
print("\nNext steps:")
print(" 1. Ensure database is initialized: python setup_database.py")
print(" 2. Run the application: python main.py")
print("\n")
if __name__ == "__main__":
main()