Skip to content

feat: Add file output options to job_analyzer - #3

Open
frenzel-ai-dev wants to merge 3 commits into
mainfrom
feature/job-analyzer-output-files
Open

feat: Add file output options to job_analyzer#3
frenzel-ai-dev wants to merge 3 commits into
mainfrom
feature/job-analyzer-output-files

Conversation

@frenzel-ai-dev

Copy link
Copy Markdown
Owner

This commit introduces new functionality to job_analyzer.py allowing you to save analysis results to a structured file.

Key changes:

  • Added command-line options:
    • --output-file (-o): Specifies the path for the output file.
    • --output-format (-f): Specifies the format of the output (JSON or Markdown).
  • If an output file is specified, results are written to the file in the chosen format (defaults to JSON).
  • If no output file is specified, results are printed to the console as before.
  • The results dictionary now consolidates top skills, resume matching, missing skills, and recommendations.
  • Added a Markdown formatter for the results.
  • Updated README.md to document the new options.
  • Added extensive unit tests for the new functionality, including CLI parsing, file generation (JSON and MD), and console output.

Note: Existing test failures in tests/test_job_analyzer.py (related to PDF parsing and specific assertion details) and tests/test_job_scraper.py (related to Selenium mocks) are known and will be addressed separately.

This commit introduces new functionality to `job_analyzer.py` allowing you to save analysis results to a structured file.

Key changes:
- Added command-line options:
    - `--output-file` (-o): Specifies the path for the output file.
    - `--output-format` (-f): Specifies the format of the output (JSON or Markdown).
- If an output file is specified, results are written to the file in the chosen format (defaults to JSON).
- If no output file is specified, results are printed to the console as before.
- The results dictionary now consolidates top skills, resume matching, missing skills, and recommendations.
- Added a Markdown formatter for the results.
- Updated `README.md` to document the new options.
- Added extensive unit tests for the new functionality, including CLI parsing, file generation (JSON and MD), and console output.

Note: Existing test failures in `tests/test_job_analyzer.py` (related to PDF parsing and specific assertion details) and `tests/test_job_scraper.py` (related to Selenium mocks) are known and will be addressed separately.
@frenzel-ai-dev
frenzel-ai-dev requested a review from Copilot May 26, 2025 22:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds file output capabilities to the job_analyzer CLI, allowing users to save analysis results in JSON or Markdown format.

  • Refactors NLTK data downloads into a dedicated download_nltk_data() function and invokes it in main().
  • Extends analyze_jobs_and_resume() to accept --output-file and --output-format, handling both JSON and Markdown exports.
  • Updates README.md to document the new CLI options.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
job_recommender/job_analyzer.py Refactored NLTK downloads, added Markdown formatter, and implemented output-file/format logic with file-writing branches.
README.md Documented -o/--output-file and -f/--output-format options.

Comment thread job_recommender/job_analyzer.py Outdated
Comment thread job_recommender/job_analyzer.py Outdated
actual_format = output_format.lower()

try:
with open(output_file, 'w', encoding='utf-8') as f:

Copilot AI May 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The JSON/Markdown file-writing logic is duplicated in both the error and main branches. Extract this into a helper function to reduce code repetition and ensure consistent behavior.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do it?

frenzel-ai-dev and others added 2 commits May 26, 2025 18:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants