-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.py
49 lines (36 loc) · 2.05 KB
/
template.py
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
import os
from pathlib import Path
list_of_files = [
'notebooks/experiments.ipynb', # folder for all jupyter notebooks
'artifacts/.gitkeep', # folder to store csv and pickle files
'requirements.txt', # requirements for projects
'requirements_dev.txt', # requirements only development environment
'src/__init__.py', # main source code folder
'src/components/__init__.py', # components
'src/components/data_ingestion.py',
'src/components/data_transformation.py',
'src/components/model_training.py',
'src/components/model_evaluation.py',
'src/pipeline/__init__.py', # pipelines
'src/pipeline/training_pipeline.py',
'src/pipeline/prediction_pipeline.py',
'src/exception.py', # custom exception handling
'src/logger.py', # logging
'src/utils.py', # common functions
'setup.py', # for converting project into package
'init_setup.sh',
'app.py', # for creating the flask application
'templates/index.html', # for creating the ui for the application
'static/css/style.css',
'.github/workflows/main.yml', # github actions workflow for ci-cd pipeline
'images/.gitkeep', # supporting images for github readme
]
# let's create the project structure
for file_path in list_of_files:
file_path = Path(file_path)
file_dir, file_name = os.path.split(file_path)
if file_dir != '':
os.makedirs(file_dir, exist_ok = True)
if (not os.path.exists(file_path)) or (os.path.getsize(file_path) == 0):
with open(file_path, 'w') as f:
pass # creating an empty file