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
  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/.gitkeep",
  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}/constants/__init__.py",
  15. f"src/{package_name}/example/__init__.py",
  16. "tests/__init__.py",
  17. "tests/unit/__init__.py",
  18. "tests/integration/__init__.py",
  19. "research/trials.ipynb",
  20. "config/config.yaml",
  21. "dvc.yaml",
  22. "params.yaml",
  23. "init_setup.sh",
  24. "requirements.txt",
  25. "requirements_dev.txt",
  26. "setup.py",
  27. "setup.cfg",
  28. "pyproject.toml",
  29. "tox.ini",
  30. "research/trials.ipynb"
  31. ]
  32. for filepath in list_of_files:
  33. filepath = Path(filepath)
  34. filedir, filename = os.path.split(filepath)
  35. if filedir != "":
  36. os.makedirs(filedir,exist_ok=True)
  37. logging.info(f"Creating directory: {filedir} for file:{filename}")
  38. if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
  39. with open(filepath, "w") as f:
  40. pass # create an empty file
  41. logging.info(f"Creating directory:{filedir}")
  42. else:
  43. logging.info(f"{filename} already exists")
Tip!

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

Comments

Loading...