Skip to content

Commit 1f872ca

Browse files
committed
folder structure
1 parent e2aacd5 commit 1f872ca

File tree

7 files changed

+32
-0
lines changed

7 files changed

+32
-0
lines changed

app.py

Whitespace-only changes.

requirements.txt

Whitespace-only changes.

research/trials.ipynb

Whitespace-only changes.

setup.py

Whitespace-only changes.

src/__init__.py

Whitespace-only changes.

src/helper.py

Whitespace-only changes.

template.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
from pathlib import Path
3+
import logging
4+
5+
logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s: ')
6+
7+
list_of_files = [
8+
f"src/__init__.py",
9+
f"src/helper.py",
10+
".env",
11+
"requirements.txt",
12+
"setup.py",
13+
"app.py",
14+
"research/trials.ipynb",
15+
]
16+
17+
for filepath in list_of_files:
18+
filepath =Path(filepath)
19+
filedir, filename = os.path.split(filepath)
20+
21+
22+
if filedir !="":
23+
os.makedirs(filedir, exist_ok=True)
24+
logging.info(f"Creating directory: {filedir} for the file: {filename}")
25+
26+
if (not os.path.exists(filepath)) or (os.path.getsize(filepath) ==0 ) :
27+
with open(filepath, "w") as f:
28+
pass
29+
logging.info(f"Creating empty file: {filepath}")
30+
31+
else :
32+
logging.info(f"{filename} is already exists")

0 commit comments

Comments
 (0)