Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving #272 & #270 (Missing directory structure) #277

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,7 @@ scripts/similarity/config.yml
*.local.yml

# Processed or local files
/Data/Processed/*
/Data/Processed/JobDescription
/Data/Processed/Resumes

*.local.pdf
16 changes: 14 additions & 2 deletions run_first.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import json
import logging
import os
import traceback


from scripts import JobDescriptionProcessor, ResumeProcessor
from scripts.utils import get_filenames_from_dir, init_logging_config

init_logging_config()

PROCESSED_RESUMES_PATH = "Data/Processed/Resumes"
PROCESSED_JOB_DESCRIPTIONS_PATH = "Data/Processed/JobDescription"
processed_Path = os.path.join(os.getcwd(), "Data", "Processed")
if not os.path.exists(os.path.join(processed_Path)):
logging.info('"/Processed/" directory structure is missing, setting up a new one.\n')
os.mkdir(processed_Path)
os.mkdir(os.path.join(processed_Path, "Resumes"))
os.mkdir(os.path.join(processed_Path, "Data"))


PROCESSED_RESUMES_PATH = os.path.join(os.getcwd(), "Data", "Processed", "Resumes")
PROCESSED_JOB_DESCRIPTIONS_PATH = os.path.join(os.getcwd(), "Data", "Processed", "JobDescription")


def read_json(filename):
Expand Down Expand Up @@ -44,6 +54,7 @@ def remove_old_files(files_path):
logging.error("There are no resumes present in the specified folder.")
logging.error("Exiting from the program.")
logging.error("Please add resumes in the Data/Resumes folder and try again.")
logging.error(str(traceback.format_exc()))
exit(1)

# Now after getting the file_names parse the resumes into a JSON Format.
Expand All @@ -66,6 +77,7 @@ def remove_old_files(files_path):
logging.error("There are no job-description present in the specified folder.")
logging.error("Exiting from the program.")
logging.error("Please add resumes in the Data/JobDescription folder and try again.")
logging.error(str(traceback.format_exc()))
exit(1)

# Now after getting the file_names parse the resumes into a JSON Format.
Expand Down