-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_wizard.py
More file actions
138 lines (116 loc) · 5.54 KB
/
Copy pathsetup_wizard.py
File metadata and controls
138 lines (116 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/usr/bin/env python3
"""
setup_wizard.py — First-run setup for the Job Application Pipeline.
Asks for your personal details and writes config.json.
Run: python setup_wizard.py
"""
import json, sys
from pathlib import Path
CONFIG_PATH = Path(__file__).parent / "config.json"
EXAMPLE_PATH = Path(__file__).parent / "config.example.json"
def ask(prompt: str, default: str = "") -> str:
suffix = f" [{default}]" if default else ""
val = input(f" {prompt}{suffix}: ").strip()
return val or default
def ask_multiline(prompt: str) -> str:
print(f" {prompt}")
print(" (type your description, press Enter twice when done)")
lines = []
blank_count = 0
while True:
line = input(" > ")
if line == "":
blank_count += 1
if blank_count >= 2 and lines:
break
else:
blank_count = 0
lines.append(line)
return " ".join(lines).strip()
def main():
print()
print("=" * 55)
print(" Job Application Pipeline — First-Run Setup")
print("=" * 55)
print()
print(" This wizard creates config.json with your details.")
print(" Your data stays local — config.json is gitignored.")
print()
if CONFIG_PATH.exists():
answer = ask("config.json already exists. Overwrite? (y/N)", "n")
if answer.lower() != "y":
print("\n Aborted. Existing config.json is unchanged.")
sys.exit(0)
print()
with open(EXAMPLE_PATH, encoding="utf-8") as f:
config = json.load(f)
# ── Personal details ──────────────────────────────────────
print("── Personal Details ──────────────────────────────────")
config["user"]["name"] = ask("Full name")
config["user"]["email"] = ask("Email address")
config["user"]["phone"] = ask("Phone (with country code, e.g. +966 50 000 0000)")
config["user"]["linkedin"] = ask("LinkedIn URL (e.g. linkedin.com/in/yourprofile)")
config["user"]["location_current"] = ask("Current city/country (e.g. Jazan, Saudi Arabia)")
config["user"]["location_target"] = ask("Target job location (e.g. Riyadh, Saudi Arabia)")
config["user"]["gpa"] = ask("GPA (e.g. 3.8/4.0 or 4.5/5.0) — leave blank to omit", "")
config["user"]["grad_year"] = ask("Graduation year", "2025")
ccna = ask("CCNA certified? (y/N)", "n")
config["user"]["ccna"] = ccna.lower() == "y"
# ── Projects ──────────────────────────────────────────────
print()
print("── Projects ──────────────────────────────────────────")
print(" Describe each project in 2–3 sentences with metrics.")
print()
try:
n_str = ask("How many projects to add", "2")
n_projects = int(n_str)
except ValueError:
n_projects = 2
config["projects"] = {}
keys = []
for i in range(n_projects):
print()
key = ask(f"Project {i + 1} key (short slug, e.g. 'tasi' or 'webapp')")
if not key:
key = f"project{i + 1}"
desc = ask_multiline(f"Project {i + 1} description:")
config["projects"][key] = desc
keys.append(key)
print()
coop = ask("Describe your internship/co-op (leave blank to skip)", "")
if coop:
config["projects"]["coop"] = coop
keys.append("coop")
# ── Role → project mapping ─────────────────────────────────
print()
print("── Role → Project Mapping ────────────────────────────")
print(f" Available keys: {', '.join(keys)}")
print(" For each role type, enter comma-separated project keys (in priority order).")
print()
default_keys = ",".join(keys[:2]) if len(keys) >= 2 else ",".join(keys)
for role in ["networking", "security", "software", "data", "sales", "support", "general"]:
val = ask(f"{role}", default_keys)
config["role_project_map"][role] = [k.strip() for k in val.split(",") if k.strip()]
# ── Hunter.io (optional) ───────────────────────────────────
print()
print("── Optional: Hunter.io Email Enrichment ──────────────")
print(" Hunter.io finds recruiter emails by company domain.")
print(" Free tier: 25 searches/month. Get a key at hunter.io")
print()
hunter_key = ask("Hunter.io API key (leave blank to skip)", "")
config["hunterio_api_key"] = hunter_key
# ── Write ──────────────────────────────────────────────────
with open(CONFIG_PATH, "w", encoding="utf-8") as f:
json.dump(config, f, ensure_ascii=False, indent=2)
print()
print("=" * 55)
print(f" config.json written to {CONFIG_PATH.name}")
print()
print(" Next steps:")
print(" python src/pipeline.py --step parse # parse your CV")
print(" python src/pipeline.py # run full pipeline")
print(" python src/pipeline.py --help # see all options")
print("=" * 55)
print()
if __name__ == "__main__":
main()