-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate_project_structure.py
More file actions
67 lines (58 loc) · 2.17 KB
/
create_project_structure.py
File metadata and controls
67 lines (58 loc) · 2.17 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
import os
def create_project_structure():
# Root folders
# root_dirs = ["frontend", "backend", "agriAI"]
root_dirs = ["agriAI"]
# agriAI specific structure
agri_dirs = [
"agriAI/data/processed",
"agriAI/data/raw",
"agriAI/data/synthetic",
"agriAI/docs",
"agriAI/models",
"agriAI/notebooks",
"agriAI/scripts/data_generation",
"agriAI/scripts/ml_service",
]
# Empty files to create inside agriAI
agri_files = [
"agriAI/scripts/data_generation/generate_prices.py",
"agriAI/scripts/data_generation/generate_recs.py",
"agriAI/scripts/data_generation/generate_soil.py",
"agriAI/scripts/data_generation/generate_weather.py",
"agriAI/scripts/data_generation/__init__.py",
"agriAI/requirements.txt",
"agriAI/.gitignore",
"agriAI/README.md",
"agriAI/.env" # For storing API keys later
]
print("🚀 Initializing AgriMarket AI Project Structure...\n")
# 1. Create Root Directories (frontend, backend, agriAI)
for folder in root_dirs:
try:
os.makedirs(folder, exist_ok=True)
print(f" 📂 Created root directory: {folder}/")
except OSError as e:
print(f" ❌ Error creating {folder}: {e}")
# 2. Create agriAI Sub-directories
for folder in agri_dirs:
try:
os.makedirs(folder, exist_ok=True)
print(f" 📂 Created sub-directory: {folder}/")
except OSError as e:
print(f" ❌ Error creating {folder}: {e}")
# 3. Create Empty Files
for file_path in agri_files:
try:
# Create file if it doesn't exist
if not os.path.exists(file_path):
with open(file_path, 'w') as f:
pass
print(f" 📄 Created file: {file_path}")
else:
print(f" ⚠️ File already exists: {file_path}")
except OSError as e:
print(f" ❌ Error creating file {file_path}: {e}")
print("\n✅ Project structure created successfully!")
if __name__ == "__main__":
create_project_structure()