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

template.py 1.4 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
  1. import os
  2. from pathlib import Path
  3. import logging
  4. logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s:')
  5. project_name="datascience"
  6. list_of_files=[
  7. ".gthub/workflows/.gitkeep",
  8. f"src/{project_name}/__init__.py",
  9. f"src/{project_name}/components/__init__.py",
  10. f"src/{project_name}/utils/__init__.py",
  11. f"src/{project_name}/utils/common.py",
  12. f"src/{project_name}/config/__init__.py",
  13. f"src/{project_name}/config/configuration.py",
  14. f"src/{project_name}/pipeline/__init__.py",
  15. f"src/{project_name}/entity/__init__.py",
  16. f"src/{project_name}/entity/config_entity.py",
  17. f"src/{project_name}/constants/__init__.py",
  18. "config/config.yaml",
  19. "params.yaml",
  20. "schema.yaml",
  21. "main.py",
  22. "Dockerfile",
  23. "setup.py",
  24. "research/research.ipynb",
  25. "templates/index.html",
  26. "app.py"
  27. ]
  28. for filepath in list_of_files:
  29. filepath=Path(filepath)
  30. filedir,filename=os.path.split(filepath)
  31. if filedir!="":
  32. os.makedirs(filedir,exist_ok=True)
  33. logging.info(f"Creating directory {filedir} for the file : {filename}")
  34. if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
  35. with open(filepath,"w") as f:
  36. pass
  37. logging.info(f"Creating empty file: {filepath}")
  38. else:
  39. logging.info(f"{filename} is already exists")
Tip!

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

Comments

Loading...