-
Notifications
You must be signed in to change notification settings - Fork 2
/
StuctureMaker.py
41 lines (30 loc) · 1.32 KB
/
StuctureMaker.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
import os
# Create main folders
folders = ['data', 'notebooks', 'src', 'tests']
for folder in folders:
os.makedirs(folder)
# Create subfolders inside data folder
data_folders = ['raw', 'processed', 'models']
for folder in data_folders:
os.makedirs(os.path.join('data', folder))
# Create subfolders inside src folder
src_folders = ['models', 'preprocessing', 'utils']
for folder in src_folders:
os.makedirs(os.path.join('src', folder))
# Create sample files inside the folders
with open(os.path.join('data', 'raw', 'data.csv'), 'w') as f:
f.write('Sample raw data')
with open(os.path.join('data', 'processed', 'data.csv'), 'w') as f:
f.write('Sample processed data')
with open(os.path.join('data', 'models', 'model.pkl'), 'wb') as f:
f.write(b'Sample model pickle file')
with open(os.path.join('src', 'models', 'model.py'), 'w') as f:
f.write('Sample model source code')
with open(os.path.join('src', 'preprocessing', 'preprocessing.py'), 'w') as f:
f.write('Sample preprocessing source code')
with open(os.path.join('src', 'utils', 'utils.py'), 'w') as f:
f.write('Sample utility source code')
with open(os.path.join('notebooks', 'EDA.ipynb'), 'w') as f:
f.write('Sample Jupyter notebook for EDA')
with open(os.path.join('tests', 'test_models.py'), 'w') as f:
f.write('Sample unit tests for models')