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
  1. import os
  2. from pathlib import Path
  3. import logging
  4. logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s :')
  5. package_name = "deepClassifier"
  6. list_of_files = [
  7. ".github/workflows/.geetkeep",
  8. f"src/{package_name}/__init__.py",
  9. f"src/{package_name}/components/__init__.py",
  10. f"src/{package_name}/utils/__init__.py",
  11. f"src/{package_name}/config/__init__.py",
  12. f"src/{package_name}/pipeline/__init__.py",
  13. f"src/{package_name}/entity/__init__.py",
  14. f"src/{package_name}/constant/__init__.py",
  15. "tests/__init__.py",
  16. "tests/unit/__init__.py",
  17. "tests/integration/__init__.py",
  18. "configs/config.yaml",
  19. "dvc.yaml",
  20. "params.yaml",
  21. "init_setup.sh",
  22. "requirements.txt",
  23. "requirements_dev.txt",
  24. "setup.py",
  25. "setup.cfg",
  26. "pyproject.toml",
  27. "tox.ini",
  28. "research/stage_01.ipynb",
  29. ]
  30. for filepath in list_of_files:
  31. filepath = Path(filepath)
  32. filedir, filename = os.path.split(filepath)
  33. if filedir != "":
  34. os.makedirs(filedir, exist_ok=True)
  35. logging.info(f"Creating a dir {filedir} and fine {filename}")
  36. if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
  37. with open(filepath, "w") as f:
  38. pass
  39. logging.info(f"Creating empty file of {filename}")
  40. else:
  41. logging.info(f"file already exist {filename}")
Tip!

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

Comments

Loading...