-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.py
More file actions
32 lines (26 loc) · 1.09 KB
/
Copy pathtemplate.py
File metadata and controls
32 lines (26 loc) · 1.09 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
"""Scaffold helper for quickly creating a text-classification module layout."""
from pathlib import Path
def create_project_structure(project_name: str) -> None:
"""Create a minimal package structure for a new module."""
file_list = [
f"{project_name}/__init__.py",
f"{project_name}/main.py",
f"{project_name}/README.md",
f"{project_name}/requirements.txt",
f"{project_name}/config/__init__.py",
f"{project_name}/preprocessing/__init__.py",
f"{project_name}/model/__init__.py",
f"{project_name}/evaluate/__init__.py",
f"{project_name}/utils/__init__.py",
]
for file in file_list:
file_path = Path(file)
file_path.parent.mkdir(parents=True, exist_ok=True)
if not file_path.exists():
file_path.write_text("", encoding="utf-8")
if __name__ == "__main__":
project_name = input("Enter project name: ").strip()
if not project_name:
raise ValueError("Project name cannot be empty")
create_project_structure(project_name)
print(f"Project scaffold created: {project_name}")