Skip to content

Commit

Permalink
folder strucutr added
Browse files Browse the repository at this point in the history
  • Loading branch information
neverbstop committed May 19, 2024
1 parent 74af22d commit 898f583
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 0 deletions.
Empty file added .github/workflows/.gitkeep
Empty file.
Empty file added Dockerfile
Empty file.
Empty file added app.py
Empty file.
Empty file added config/config.yaml
Empty file.
Empty file added main.py
Empty file.
Empty file added requirements.txt
Empty file.
Empty file added research/trials.ipynb
Empty file.
Empty file added setup.py
Empty file.
Empty file added src/textsummarizer/__init__.py
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
42 changes: 42 additions & 0 deletions template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import os
from pathlib import Path
import logging

logging.basicConfig(level=logging.INFO, format='%(asctime)s: %(message)s')

project_name = "textsummarizer"

list_of_files = [
".github/workflows/.gitkeep",
f"src/{project_name}/__init__.py",
f"src/{project_name}/components/__init__.py",
f"src/{project_name}/utils/__init__.py",
f"src/{project_name}/utils/common.py",
f"src/{project_name}/logging/__init__.py",
f"src/{project_name}/config/configuration.py",
f"src/{project_name}/pipeline/__init__.py",
f"src/{project_name}/entity/__init__.py",
f"src/{project_name}/constants/__init__.py",
"config/config.yaml",
"app.py",
"main.py",
"Dockerfile",
"requirements.txt",
"setup.py",
"research/trials.ipynb",
"test.py"
]

for filepath in list_of_files:
filepath = Path(filepath)
filedir, filename = os.path.split(filepath)
if filedir != "":
os.makedirs(filedir, exist_ok=True)
logging.info(f"Creating directory: {filedir} for the file {filename}")

if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
with open(filepath, 'w') as f:
pass
logging.info(f"Creating empty file: {filepath}")
else:
logging.info(f"{filepath} already exists")
Empty file added test.py
Empty file.

0 comments on commit 898f583

Please sign in to comment.