Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

project_template.py 2.1 KB

You have to be logged in to leave a comment. Sign In
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
  1. import os
  2. import re # type: ignore
  3. #####################################################################
  4. # To create folders
  5. folders = [
  6. 'src',
  7. os.path.join('src', 'components'),
  8. os.path.join('src', 'pipeline'),
  9. os.path.join('src', 'config'),
  10. os.path.join('src', 'entity'),
  11. os.path.join('src', 'constants'),
  12. 'artifacts',
  13. os.path.join('artifacts', 'data'),
  14. os.path.join('artifacts/data', 'raw'),
  15. os.path.join('artifacts/data', 'temp'),
  16. os.path.join('artifacts/data', 'processed'),
  17. os.path.join('artifacts/data/processed', 'stage_1_initial_processing'),
  18. os.path.join('artifacts/data/processed', 'stage_2_validation'),
  19. os.path.join('artifacts/data/processed', 'stage_3_final_processing'),
  20. os.path.join('artifacts/data', 'train_test'),
  21. os.path.join('artifacts/data', 'final_testing_data_and_predicted_data'),
  22. os.path.join('artifacts', 'model'),
  23. os.path.join('artifacts/model', 'hp_tuned_model'),
  24. os.path.join('artifacts', 'metrics'),
  25. os.path.join('artifacts', 'preprocessor'),
  26. 'Secrets',
  27. os.path.join('Secrets', 'Bundles'),
  28. os.path.join('Secrets', 'Keys'),
  29. os.path.join('Secrets', 'Tokens'),
  30. os.path.join('Secrets', 'Secrets'),
  31. 'templates',
  32. 'static',
  33. 'config'
  34. ]
  35. for i in folders:
  36. os.makedirs(i, exist_ok=True)
  37. if re.findall('src', i):
  38. with open(os.path.join(i, '__init__.py'), 'w'):
  39. pass
  40. #####################################################################
  41. # To create files
  42. files = [
  43. os.path.join('src', 'utils.py'),
  44. 'schema.yaml',
  45. 'params.yaml',
  46. 'dvc.yaml'
  47. 'app.py',
  48. 'setup.py',
  49. os.path.join('config', 'config.yaml'),
  50. os.path.join('templates', 'index.html'),
  51. os.path.join('templates', 'result.html')
  52. ]
  53. for i in files:
  54. with open(i, 'w'):
  55. pass
  56. #####################################################################
  57. # To create .gitkeep file in empty folders for initial git committing
  58. for i in folders:
  59. if any(os.listdir(i)):
  60. pass
  61. else:
  62. with open(os.path.join(i, '.gitkeep'), 'w'):
  63. pass
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...