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
|
- import os
- import re # type: ignore
- #####################################################################
- # To create folders
- folders = [
- 'src',
- os.path.join('src', 'components'),
- os.path.join('src', 'pipeline'),
- os.path.join('src', 'config'),
- os.path.join('src', 'entity'),
- os.path.join('src', 'constants'),
- 'artifacts',
- os.path.join('artifacts', 'data'),
- os.path.join('artifacts/data', 'raw'),
- os.path.join('artifacts/data', 'temp'),
- os.path.join('artifacts/data', 'processed'),
- os.path.join('artifacts/data/processed', 'stage_1_initial_processing'),
- os.path.join('artifacts/data/processed', 'stage_2_validation'),
- os.path.join('artifacts/data/processed', 'stage_3_final_processing'),
- os.path.join('artifacts/data', 'train_test'),
- os.path.join('artifacts/data', 'final_testing_data_and_predicted_data'),
- os.path.join('artifacts', 'model'),
- os.path.join('artifacts/model', 'hp_tuned_model'),
- os.path.join('artifacts', 'metrics'),
- os.path.join('artifacts', 'preprocessor'),
- 'Secrets',
- os.path.join('Secrets', 'Bundles'),
- os.path.join('Secrets', 'Keys'),
- os.path.join('Secrets', 'Tokens'),
- os.path.join('Secrets', 'Secrets'),
- 'templates',
- 'static',
- 'config'
- ]
- for i in folders:
- os.makedirs(i, exist_ok=True)
- if re.findall('src', i):
- with open(os.path.join(i, '__init__.py'), 'w'):
- pass
- #####################################################################
- # To create files
- files = [
- os.path.join('src', 'utils.py'),
- 'schema.yaml',
- 'params.yaml',
- 'dvc.yaml'
- 'app.py',
- 'setup.py',
- os.path.join('config', 'config.yaml'),
- os.path.join('templates', 'index.html'),
- os.path.join('templates', 'result.html')
- ]
- for i in files:
- with open(i, 'w'):
- pass
- #####################################################################
- # To create .gitkeep file in empty folders for initial git committing
- for i in folders:
- if any(os.listdir(i)):
- pass
- else:
- with open(os.path.join(i, '.gitkeep'), 'w'):
- pass
|