The AI CV Generator is a Python tool designed to process and refine resumes using Google's Gemini Large Language Model. It takes raw CV text or pdf resume as input and applies a user-defined sequence of AI-powered transformations to produce a polished editable Markdown document.
- AI-Powered CV Processing: Leverages Google's Gemini API for intelligent text generation and transformation.
- Flexible Input: Accepts raw CV text or PDF format resumes from a file.
- Markdown Output: Generates clean, readable, and professional CVs in Markdown format.
- Customizable Processing Pipeline:
- Applies a sequence of processing steps, each driven by a specific prompt.
- The sequence of steps is defined in
src/cv_generator/generator.py(thestepslist). - Prompts are defined and can be customized in
src/cv_generator/prompts.py.
- Configurable AI: Allows configuration of the Gemini model, safety settings, and generation parameters.
- Modern Python Tooling:
- Uses
uvfor fast dependency and virtual environment management. - Employs
rufffor linting and formatting. - Includes
pytestfor automated testing.
- Uses
- Continuous Integration: GitHub Actions workflow for automated linting and testing on pushes and pull requests.
-
Clone the repository:
git clone https://github.com/kasztp/ai_cv_generator.git cd ai_cv_generator -
Install
uv(if you haven't already): Follow instructions at https://github.com/astral-sh/uv or use pipx:pipx install uv
-
Create and activate a virtual environment:
uv venv
Activate it:
- macOS/Linux:
source .venv/bin/activate - Windows:
.venv\Scripts\activate
- macOS/Linux:
-
Install dependencies:
uv pip install -e '.[dev]'(
-einstalls in editable mode,[dev]includes testing/linting tools) -
Set up Environment Variables:
-
Copy the example environment file:
cp .env.example .env
-
Edit the
.envfile and add your Google Gemini API key:GEMINI_API_KEY="YOUR_ACTUAL_API_KEY_HERE"
Important: Never commit your actual
.envfile to Git. It's already included in.gitignore.
-
-
Prepare Input:
- Have your raw CV text or PDF resume ready in a file (e.g.,
input_cvs/my_cv.txtorinput_cvs/my_resume.pdf).
- Have your raw CV text or PDF resume ready in a file (e.g.,
-
(Optional) Customize Processing Steps & Prompts:
- The core logic of CV transformation lies in the sequence of prompts applied.
- Define Prompts: Review and modify the prompts in
src/cv_generator/prompts.pyto suit your desired transformations (e.g., formatting, summarizing sections, extracting specific information, rephrasing). - Define Processing Sequence: Edit the
stepslist within themain()function ofsrc/cv_generator/generator.py. Each element in this list typically defines a prompt to use and an optional description for logging. This allows you to chain multiple AI transformations. For example:
# In src/cv_generator/generator.py processing_steps = [ {"prompt_name": "FORMAT_MARKDOWN_PROMPT", "description": "Formatting CV to Markdown"}, {"prompt_name": "SUMMARIZE_EXPERIENCE_PROMPT", "description": "Summarizing key experiences"}, # Add more steps as needed ]
-
Run the Generator: Provide the path to your input CV file as the main argument. You can optionally specify an output file path using
-oor--output.-
Using python module:
# Process input_cvs/my_cv.txt and save to the default output/generated_cv.md python -m cv_generator.generator input_cvs/my_cv.txt # Process another_cv.txt and save to a specific file python -m cv_generator.generator input_cvs/another_cv.txt -o output/another_cv_processed.md
-
Using the installed script (if virtual environment is active):
# Example: # generate-cv input_cvs/my_cv.txt --output output/custom_output.md
-
-
Output: The generated Markdown CV will be saved to the specified output path (defaulting to
output/generated_cv.md).
The project uses uv to manage development tasks defined as scripts in pyproject.toml (or run directly).
-
Linting (with Ruff): Check for code style and errors.
uv run ruff check src tests
-
Formatting (with Ruff): Automatically format the code.
uv run ruff format src tests
-
Testing (with Pytest): Run the test suite.
uv run pytest
The Continuous Integration (CI) workflow is defined in .github/workflows/ci.yml. It automatically runs linters (ruff check) and tests (pytest) on every push and pull request to the main branch to ensure code quality and correctness.