Skip to content

Commit e96c32c

Browse files
committed
project template added
1 parent 866edda commit e96c32c

File tree

14 files changed

+43
-0
lines changed

14 files changed

+43
-0
lines changed

.github/workflows/.gitkeep

Whitespace-only changes.

config/config.yaml

Whitespace-only changes.

params.yaml

Whitespace-only changes.

requirements.txt

Whitespace-only changes.

research/trials.ipynb

Whitespace-only changes.

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import os

src/ImageClassification/__init__.py

Whitespace-only changes.

src/ImageClassification/components/__init__.py

Whitespace-only changes.

src/ImageClassification/config/__init__.py

Whitespace-only changes.

src/ImageClassification/constants/__init__.py

Whitespace-only changes.

src/ImageClassification/entity/__init__.py

Whitespace-only changes.

src/ImageClassification/pipeline/__init__.py

Whitespace-only changes.

src/ImageClassification/utils/__init__.py

Whitespace-only changes.

template.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import os
2+
from pathlib import Path
3+
import logging
4+
5+
logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s:')
6+
7+
project_name = "ImageClassification"
8+
9+
list_of_files = [
10+
".github/workflows/.gitkeep",
11+
f"src/{project_name}/__init__.py",
12+
f"src/{project_name}/components/__init__.py",
13+
f"src/{project_name}/utils/__init__.py",
14+
f"src/{project_name}/config/__init__.py",
15+
f"src/{project_name}/pipeline/__init__.py",
16+
f"src/{project_name}/entity/__init__.py",
17+
f"src/{project_name}/constants/__init__.py",
18+
"config/config.yaml",
19+
"params.yaml",
20+
"requirements.txt",
21+
"setup.py",
22+
"research/trials.ipynb"
23+
24+
]
25+
26+
for filepath in list_of_files:
27+
filepath = Path(filepath)
28+
filedir, filename = os.path.split(filepath)
29+
30+
if filedir != "":
31+
os.makedirs(filedir, exist_ok=True)
32+
logging.info(f"Creating directory: {filedir} for file: {filename}")
33+
34+
if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
35+
with open(filepath, 'w') as f:
36+
pass #Creating an empty file only
37+
logging.info(f"Creating empty file: {filepath}")
38+
39+
else:
40+
logging.info(f"{filename} is already exists")
41+
42+

0 commit comments

Comments
 (0)