How to Customize the CSV Export Format in Development Mode in Hiring Agent
In the interviewstreet/hiring-agent repository, you customize CSV exports by modifying the transform_evaluation_response function in transform.py, because the development mode flag only affects API response caching and leaves the CSV generation logic unchanged.
The interviewstreet/hiring-agent repository generates CSV exports of evaluated résumés through a dictionary-to-file pipeline. When running in development mode, the application caches intermediate API responses to speed up repeated runs, but the CSV formatting logic remains identical to production. Understanding this architecture lets you tailor the export format without worrying about environment-specific behavior.
Understanding the CSV Export Pipeline
The CSV creation process follows a strict three-step path regardless of whether DEVELOPMENT_MODE is enabled. First, the transform_evaluation_response function in transform.py (around line 497) converts an Evaluation object into a plain Python dictionary. Second, this dictionary's keys become the CSV column headers. Third, the code in score.py (lines 350–354) writes these dictionary entries to resume_evaluations.csv, using the insertion order of keys to determine the header sequence.
The DEVELOPMENT_MODE flag defined in config.py (lines 5–6) only gates caching behavior. When True, the system checks for existing cache files before making API calls, but it does not branch the CSV writing logic. This means any format customization you implement applies uniformly across both development and production environments.
Modifying the Export Structure
Because score.py blindly writes whatever dictionary transform_evaluation_response returns, all customization happens inside transform.py. The function constructs a csv_row dictionary, and every key you add, remove, or reorder directly alters the resulting spreadsheet layout.
Adding Custom Columns
To include additional data points, insert new key-value pairs into csv_row before the function returns. For example, to add a candidate source column:
# transform.py – inside transform_evaluation_response(...)
csv_row = {}
# existing fields …
csv_row["total_score"] = total_score
csv_row["total_max"] = total_max
# ---- Custom addition ----
csv_row["candidate_source"] = evaluation.metadata.get("source", "unknown")
# -------------------------
return csv_row
Result: The CSV header appends candidate_source as the rightmost column.
Reordering Columns
The CSV generator respects Python's insertion order for dictionary keys. To move fields left or right, simply change the sequence in which you populate csv_row:
def transform_evaluation_response(evaluation, basics, ...):
csv_row = {}
# Re‑ordered insertion
csv_row["email"] = basics.email if basics.email else ""
csv_row["name"] = basics.name if basics.name else ""
# Rest of the fields …
csv_row["phone"] = basics.phone if basics.phone else ""
# …
return csv_row
Result: The resulting CSV lists email before name in the header row.
Removing or Renaming Fields
To eliminate a column, omit its key from the dictionary entirely. To rename it, change the key string while keeping the value assignment:
def transform_evaluation_response(...):
csv_row = {}
# ...populate fields...
# Omit the twitter_username entry
# csv_row["twitter_username"] = twitter_profile.username # <-- removed
# Rename maximum_score to max_possible_score
csv_row["max_possible_score"] = evaluation.maximum_score
return csv_row
Result: The export excludes twitter_username and displays max_possible_score instead of the original key name.
Development Mode Considerations
Setting DEVELOPMENT_MODE = True in config.py activates a caching layer that stores API responses to disk, allowing faster iteration when debugging scoring logic. However, this flag does not intercept or modify the CSV serialization path in score.py. The dictionary-to-CSV conversion executes identically in both modes, ensuring that your format customizations remain consistent across environments.
If you observe stale data in development mode, clear the cache files rather than adjusting the CSV logic. The export format itself updates immediately upon saving changes to transform_evaluation_response.
Summary
- The
transform_evaluation_responsefunction intransform.py(line 497) controls CSV structure by returning a dictionary whose keys become column headers. - The
DEVELOPMENT_MODEflag inconfig.py(lines 5–6) only toggles API response caching and does not affect CSV generation. - Customization options include adding keys for new columns, reordering insertion sequences to rearrange headers, and removing or renaming keys to alter column presence and labels.
- No environment-specific branching is required; changes to
transform.pyapply identically in development and production.
Frequently Asked Questions
Does development mode change where the CSV file is saved?
No. According to the hiring-agent source code in score.py (lines 350–354), the output path resume_evaluations.csv is hardcoded and remains constant regardless of the DEVELOPMENT_MODE setting. The flag only influences whether the system reads from a local cache before evaluating résumés.
Can I change the CSV delimiter or file encoding?
The current implementation in score.py uses standard comma-separated values without an explicit encoding parameter. To modify the delimiter or force UTF-8 with BOM, you would need to edit the CSV writing block in score.py where the file handle is created, as the development mode flag does not expose formatting options.
Why aren't my CSV column changes appearing in development mode?
If you have modified transform_evaluation_response but see old headers, you are likely viewing a cached version of previous API responses. Because DEVELOPMENT_MODE caches evaluations to disk, delete the cache files to force a fresh evaluation that uses your updated dictionary structure. The CSV writing logic itself updates immediately upon code changes.
Is there a configuration file to adjust CSV columns without editing Python code?
No. The interviewstreet/hiring-agent repository does not provide a YAML or JSON configuration for CSV schemas. All column definitions reside directly in the transform_evaluation_response function within transform.py. To customize the export, you must edit the Python source code.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →