---
type: "Source File"
title: "!/usr/bin/env python3"
description: "#!/usr/bin/env python3 \"\"\"Fix wrapper: reads original seed_extra.py, extracts data, fixes automation_prob and adds career paths.\"\"\" import sqlite3, os, sys, re from pathlib import Path from datetime import datetime DB."
resource: "https://careers.copecheck.com"
tags: ["copecheck", "careers", "source-file", "py"]
timestamp: "2026-05-03T17:14:39Z"
site: "careers"
source_path: "copecheck-careers/seed_extra_fix_v2.py"
---

# !/usr/bin/env python3

Source path: `copecheck-careers/seed_extra_fix_v2.py`  
Index snapshot generated: `2026-11-24T13:27:52Z`  
File modified: `2026-05-03T17:14:39Z`

```py
#!/usr/bin/env python3
"""Fix wrapper: reads original seed_extra.py, extracts data, fixes automation_prob and adds career paths."""
import sqlite3, os, sys, re
from pathlib import Path
from datetime import datetime

DB = str(Path(__file__).parent / "data" / "careers.db")
conn = sqlite3.connect(DB)
now = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')

# Read the original seed_extra.py and extract just the data arrays
orig_path = str(Path(__file__).parent / "seed_extra.py")
with open(orig_path) as f:
    src = f.read()

# Extract just the data portion (everything before 'for j in EXTRA_JOBS')
cut = src.find('\nfor j in EXTRA_JOBS:')
if cut > 0:
    data_src = src[:cut]
else:
    data_src = src

# Exec data in isolated namespace (set __file__ so Path works)
ns = {'__file__': orig_path}
exec(data_src, ns)
EXTRA_JOBS = ns['EXTRA_JOBS']
EXTRA_DEGREES = ns['EXTRA_DEGREES']

DEGREE_CAREER_PATHS = {
    "communications-degree": "PR Specialist, Social Media Manager, Content Strategist, Corporate Communications Manager",
    "public-relations-degree": "PR Manager, Communications Director, Media Relations Specialist, Crisis Communications Consultant",
    "library-science-degree": "Librarian, Archivist, Information Specialist, Digital Preservation Manager",
    "information-systems-degree": "IT Manager, Systems Analyst, Database Administrator, Cloud Architect",
    "human-resources-management-degree": "HR Manager, Recruiter, Benefits Administrator, Employee Relations Specialist",
    "political-science-degree": "Policy Analyst, Campaign Manager, Government Affairs Director, Lobbyist",
    "hospitality-management-degree": "Hotel Manager, Restaurant Manager, Event Coordinator, Tourism Director",
    "civil-engineering-degree": "Civil Engineer, Structural Engineer, Project Manager, Urban Planner",
    "biomedical-engineering-degree": "Biomedical Engineer, Medical Device Designer, Clinical Engineer, Regulatory Affairs Specialist",
    "chemistry-degree": "Chemist, Lab Technician, Pharmaceutical Researcher, Quality Control Analyst",
    "physics-degree": "Physicist, Data Scientist, Quantitative Analyst, Research Scientist",
    "mathematics-degree": "Mathematician, Data Scientist, Quantitative Analyst, Actuary",
    "environmental-science-degree": "Environmental Consultant, Conservation Scientist, Sustainability Manager, Environmental Compliance Officer",
    "international-relations-degree": "Diplomat, Policy Analyst, Intelligence Analyst, International Development Officer",
    "occupational-therapy-degree": "Occupational Therapist, Rehabilitation Specialist, Ergonomics Consultant, Pediatric OT",
    "physiotherapy-degree": "Physiotherapist, Sports Rehabilitation Specialist, Clinical Researcher, Pain Management Therapist",
    "veterinary-medicine-degree": "Veterinarian, Animal Surgeon, Veterinary Researcher, Public Health Veterinarian",
    "dental-degree": "Dentist, Oral Surgeon, Orthodontist, Dental Public Health Specialist",
    "paramedicine-degree": "Paramedic, Emergency Medical Technician, Flight Paramedic, Emergency Department Technician",
    "speech-pathology-degree": "Speech Pathologist, Language Therapist, Audiologist, Communication Disorders Researcher",
}

# Jobs: fix automation_prob from int to float
for j in EXTRA_JOBS:
    auto_prob = j[8] / 100.0 if j[8] > 1 else j[8]
    conn.execute("""INSERT OR REPLACE INTO jobs (id,name,category,description,median_salary_usd,median_salary_gbp,
        uk_employment,us_employment,automation_prob,ai_exposure_score,cope_score,last_cope_type,total_entries,last_scored,created_at,updated_at)
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,1,?,?,?)""",
        (j[0],j[1],j[2],j[3],j[4],j[5],j[6],j[7],auto_prob,j[9],j[10],j[11],now,now,now))
    conn.execute("""INSERT INTO cope_entries (entity_type,entity_id,quote,source_url,source_title,cope_score,cope_type,analysis_md,model,created_at)
        VALUES ('job',?,?,?,?,?,?,?,'claude-opus-4-6',?)""",
        (j[0], j[3], "https://copecheck.com/careers", "CopeCheck Careers Initial Assessment", j[10], j[11], j[12], now))

# Degrees: add missing career_paths, position 8 is ai_exposure not career_paths
for d in EXTRA_DEGREES:
    career_paths = DEGREE_CAREER_PATHS.get(d[0], "Various career paths")
    conn.execute("""INSERT OR REPLACE INTO degrees (id,name,category,description,avg_starting_salary_usd,avg_starting_salary_gbp,
        uk_graduates_annual,us_graduates_annual,primary_career_paths,ai_exposure_score,cope_score,last_cope_type,total_entries,last_scored,created_at,updated_at)
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,1,?,?,?)""",
        (d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],career_paths,d[8],d[9],d[10],now,now,now))
    conn.execute("""INSERT INTO cope_entries (entity_type,entity_id,quote,source_url,source_title,cope_score,cope_type,analysis_md,model,created_at)
        VALUES ('degree',?,?,?,?,?,?,?,'claude-opus-4-6',?)""",
        (d[0], d[3], "https://copecheck.com/careers", "CopeCheck Careers Initial Assessment", d[9], d[10], d[11], now))

conn.commit()
conn.close()
print(f"SUCCESS: Inserted {len(EXTRA_JOBS)} extra jobs and {len(EXTRA_DEGREES)} extra degrees")
```
