# -*- coding: utf-8 -*-
"""Round 256: batch add 5 Physics PhD (sixth tier)
- UNC Chapel Hill Physics PhD (Dec 1, 2026; GRE General NOT required; Physics GRE NOT required; TOEFL iBT 95; ETS #5816 no dept code; 4 DWE1 + 4 electives; full funding; expected NC residency by Year 2; research biophysics/medical physics/condensed matter/nanotechnology/nuclear/neutrino/QFT/particle/GR/astrophysics)
- Northwestern Physics PhD (Jan 1, 2027; GRE General + Physics optional; Astronomy PhD NOT accepted; TOEFL 90; $95 fee; decisions mid-Feb; 12-month fellowship first year; full funding; ties to Argonne/Fermilab; joint faculty Materials/Chemistry/EEE)
- Georgetown Physics PhD (Jan 15, 2027; GRE General + Physics Subject waived for 2026-27 cycle; TOEFL iBT 100; IELTS 7.5; no Duolingo since July 2021; $90 fee; GPA 3.0; 34 credits; two tracks Standard Physics / Industrial Leadership in Physics; 3 lab rotations; Annual Progress Report by Sept 15)
- UPenn Physics & Astronomy PhD (Dec 8, 2026 11:59pm EST; GRE NOT required; TOEFL required; $90 fee; 3 LOR; ~12% admission; Fall only; 5-year; research astrophysics/cosmology, nuclear/particle, condensed matter, AMO)
- JHU Physics PhD (William H. Miller III Dept; Dec 15, 2026; GRE General + Physics Subject optional; TOEFL iBT 100 / 600 paper; IELTS accepted; $75 fee waivable; 3 LOR; research astronomy/condensed matter/particle/plasma spectroscopy; separate from Astronomy & Astrophysics PhD)
Key finding: sixth tier fully GRE-free - UNC/Gtown explicitly waive; Northwestern split (Physics optional, Astronomy not accepted); UPenn/JHU optional.
"""
import os, re

BASE = os.path.dirname(os.path.abspath(__file__))
DET = os.path.join(BASE, "details")
os.makedirs(DET, exist_ok=True)

PROGRAMS = [
    {
        "id": "unc-physics-phd",
        "s": "unc",
        "n": "物理与天文博士",
        "en": "PhD in Physics (University of North Carolina at Chapel Hill, College of Arts and Sciences, Department of Physics and Astronomy; located in Chapel Hill, NC; research strengths in biophysics, medical physics, condensed matter, materials, nanotechnology, nuclear physics, neutrino physics, QFT, theoretical particle, GR, extragalactic/stellar astronomy, astrophysics)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 5-6 years; required coursework = 4 DWE1 courses + 4 electives (PHYS 631, PHYS 632, and 700-level or above count as electives); thesis proposal presentation (minimum residence fulfilled by end of semester in which thesis proposal is presented); thesis defense (~45-minute open departmental presentation + closed exam with thesis committee); dissertation submitted 2 weeks before defense; on-campus residential (Chapel Hill, NC); Fall admission primarily",
        "ddl": "Fall 2027: **Deadline December 1, 2026** per Department of Physics and Astronomy graduate admissions page. Applications handled by UNC Graduate School; review begins late December or as soon as applications complete. UNC Graduate School recommends December 15, 2026 for full fellowship consideration, but Physics program deadline is December 1, 2026.",
        "lang": "TOEFL iBT minimum 95 for non-native English speakers per Department FAQ. ETS institution code 5816 (no department code needed). Test scores must be official and reported directly by ETS; current and no more than 5 years old. Standardized test scores kept on file for one year after term for which applied.",
        "test": {"cls": "GRE GENERAL NOT REQUIRED; GRE PHYSICS SUBJECT NOT REQUIRED (UNC Physics FAQ: 'The General GRE test is not required. The Physics GRE subject test is not required.' ETS institution 5816 no department code. Required materials: SOP at least one page (past academic/research/leadership activities), Resume/CV (research, outreach, leadership, teaching, extracurricular, publications/presentations/posters, awards/recognitions)."},
        "tui": "UNC Physics PhD students receive multi-year fully-funded support through Research Assistantships, Teaching Assistantships, and fellowships, including tuition, stipend, and health insurance. All eligible students are expected to acquire North Carolina residency status for tuition purposes by beginning of second year (department pays tuition on student's behalf; in-state vs out-of-state tuition difference can amount to $17,000+ per year). Research strengths in biophysics, medical physics, condensed-matter physics, materials physics, nanotechnology, nuclear physics, neutrino physics and nuclear astrophysics, quantum field theory, theoretical particle physics, general relativity and gravitation, extragalactic and stellar astronomy, and astrophysics.",
        "url": "details/unc-physics-phd.html",
    },
    {
        "id": "nu-physics-phd",
        "s": "nu",
        "n": "物理博士",
        "en": "PhD in Physics (Northwestern University, Weinberg College of Arts and Sciences, Department of Physics and Astronomy; located in Evanston, IL; Physics PhD deadline Jan 1, 2027; Astronomy PhD deadline Dec 15, 2026 with GRE NOT accepted; Applied Physics PhD also available - this entry is Physics)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 5-6 years; first-year students typically supported by 12-month fellowships giving opportunity to rotate and choose research advisor; advanced coursework in physics and astronomy; research leading to dissertation; opportunities to spend significant time at off-campus facilities such as CERN or astronomical observatories; on-campus residential (Evanston, IL); Fall admission",
        "ddl": "Fall 2027: **Deadline January 1, 2027** for Physics PhD. Applications open September 15, 2026. Application fee $95. Decisions beginning mid-February. Note: Astronomy PhD deadline is December 15, 2026 (and GRE scores NOT accepted for Astronomy PhD). Applied Physics PhD is also a separate program.",
        "lang": "TOEFL iBT minimum 90 for PhD applicants per The Graduate School. International students required to submit scores from tests such as TOEFL. ETS institution code for Northwestern. Official scores required upon matriculation.",
        "test": {"cls": "GRE GENERAL OPTIONAL; GRE PHYSICS SUBJECT OPTIONAL (Northwestern Physics & Astronomy: 'For students applying to the Physics PhD program for fall 2027, GRE (General and Physics) scores are optional.' CRITICAL DISTINCTION: 'For students applying to the Astronomy PhD program for fall 2027, GRE (General and Physics) scores are not accepted.' Master's program also optional. At least two letters of recommendation from professors familiar with work; Statement of Purpose; transcripts."},
        "tui": "Northwestern Physics PhD students are fully funded. First-year students are typically supported by 12-month fellowships, giving opportunity to explore research areas before committing to a specific advisor. Department is particularly strong in multi-disciplinary research, with joint faculty in Materials Science, Chemistry, and Electrical Engineering, and strong ties to Argonne National Laboratory and Fermi National Accelerator Laboratory. Students in certain areas may spend significant time at off-campus facilities such as CERN or at astronomical observatories around the world. Note: this entry is Physics PhD; Astronomy PhD (separate) and Applied Physics PhD are also available.",
        "url": "details/nu-physics-phd.html",
    },
    {
        "id": "geo-physics-phd",
        "s": "geo",
        "n": "物理博士",
        "en": "PhD in Physics (Georgetown University, Graduate School of Arts and Sciences, Department of Physics; located in Washington, DC; two tracks: Standard Physics Track and Industrial Leadership in Physics Track; 34 credits PhD coursework; 3 lab rotations; research strengths in biological physics, hard/soft condensed matter, micro/nano technologies, optics and imaging, physics education, statistical physics, ultracold gases)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 5-6 years; at least 34 credits of graduate coursework in physics and related fields; Integrative Experience after first two semesters of coursework; 3 lab rotations; final grade of B or better in each first-year core course OR pass comprehensive examination; Qualifying Examination; research, write, and defend dissertation; Annual Progress Report submitted by September 15 detailing work over previous year; on-campus residential (Washington, DC); Fall admission",
        "ddl": "Fall 2027: **Deadline January 15, 2027** per Graduate School deadlines (11:59 PM EST). Application fee $90. All applications submitted electronically through Georgetown University Office of Graduate Admissions application portal. Office of Graduate Admissions will not accept credentials via email or fax.",
        "lang": "TOEFL iBT minimum 100 (original score scale) or 5 on new TOEFL iBT score scale beginning January 21, 2026; IELTS minimum 7.5. NOTE: Georgetown University discontinued use of Duolingo English Test for Graduate Admissions effective July 2021. Minimum GPA 3.0 in accredited undergraduate program; master's applicants expected GPA 3.5.",
        "test": {"cls": "GRE GENERAL WAIVED; GRE PHYSICS SUBJECT WAIVED for 2026-2027 admission cycle (Georgetown Physics: 'GRE scores will NOT be required this year, and their absence will not be used to count against any applicant.' Required materials: online application, application fee $90, transcripts (official copies from all undergrad/grad institutions), Resume/CV, 3 letters of recommendation."},
        "tui": "Georgetown Physics PhD students receive multi-year fully-funded support through Research Assistantships, Teaching Assistantships, and fellowships, including tuition, stipend, and health insurance. The department is a vibrant community with close student-faculty interaction; novel Industrial Leadership in Physics track prepares doctoral students for careers bridging academic research and industrial R&D. Faculty-led research groups are sponsored by grants from NSF, AFOSR, and DOE. Research areas: Biological Physics, Hard Condensed Matter, Micro and Nano Technologies, Optics and Imaging, Physics Education, Soft Condensed Matter, Statistical Physics, Ultracold Gases.",
        "url": "details/geo-physics-phd.html",
    },
    {
        "id": "up-physics-phd",
        "s": "up",
        "n": "物理与天文博士",
        "en": "PhD in Physics and Astronomy (University of Pennsylvania, School of Arts and Sciences, Department of Physics and Astronomy; located in Philadelphia, PA; ~12% admission rate; 5-year typical; research strengths in astrophysics/cosmology, nuclear/particle, condensed matter, AMO; Fall admission only)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 5 years; short term of coursework followed by independent original research forming basis of dissertation and typically first publications; rich program of seminars and colloquia; typical preparation includes intermediate and advanced courses in mechanics, electricity and magnetism, quantum mechanics, and undergraduate laboratory courses; on-campus residential (Philadelphia, PA); Fall admission only (no spring admission)",
        "ddl": "Fall 2027: **Deadline December 8, 2026 at 11:59 PM EST** per Department of Physics and Astronomy FAQ. Application opens October 1, 2026. Application fee $90. Physics and Astronomy only enrolls new students for Fall semester.",
        "lang": "TOEFL exam required for international students (native language not English). Per historical FAQ, TOEFL should be computer-based at least 100. Test scores valid 2 years. Official scores required upon matriculation.",
        "test": {"cls": "GRE NOT REQUIRED (UPenn Physics & Astronomy: 'GRE exams are not required for Fall 2026 admissions.' Submitted GRE scores may provide supplementary information - applicants who feel GRE demonstrates an ability not shown otherwise may note this in research/personal statement. Required: 3 letters of recommendation, undergraduate transcript, graduate transcript if applicable, personal statement. No minimum GRE verbal/quantitative specified."},
        "tui": "UPenn Physics & Astronomy PhD students typically receive multi-year fully-funded support through Research Assistantships, Teaching Assistantships, and fellowships, including tuition, stipend, and health insurance. The department is regarded as among the very best places for graduate students to obtain a PhD; students combine short term of coursework with independent original research that forms basis of dissertation and typically first publications. Rich program of seminars and colloquia by invited speakers. Typical admission rate ~12% of applicants. Research: astrophysics and cosmology (structure/evolution of universe, exoplanets, galaxy formation, dark matter, CMB, Dark Energy Survey, LSST), nuclear and particle (string theory, LHC at CERN, Higgs boson, supersymmetry, neutrino Majorana/CP violation), condensed matter, AMO.",
        "url": "details/up-physics-phd.html",
    },
    {
        "id": "jhu-physics-phd",
        "s": "jhu",
        "n": "物理博士",
        "en": "PhD in Physics (Johns Hopkins University, Zanvyl Krieger School of Arts and Sciences, William H. Miller III Department of Physics and Astronomy; located in Baltimore, MD; research strengths in astronomy, condensed matter, particle physics, plasma spectroscopy; separate from Astronomy and Astrophysics PhD)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 5-6 years; flexible course of research and path through program; graduate students have flexibility in choosing research and designing path; leading to dissertation; on-campus residential (Baltimore, MD); September (Fall) admission",
        "ddl": "Fall 2027 (September matriculation): **Deadline December 15, 2026** per Department of Physics and Astronomy admissions. All applications submitted online through Graduate Admissions portal. Application fee $75 (non-refundable; may be waived). Note: this entry is Physics PhD; Astronomy and Astrophysics PhD is a separate doctoral program in the same department.",
        "lang": "TOEFL iBT minimum 100 (preferred; equivalent to 600 paper-based or 250 computer-based); IELTS also accepted. A reproduction (photocopy) acceptable at application; official scores required upon admission. ETS institution code for Johns Hopkins University.",
        "test": {"cls": "GRE GENERAL OPTIONAL; GRE PHYSICS SUBJECT OPTIONAL (JHU e-Catalogue 2026-27: 'submission of General GRE and Physics GRE scores is optional.' Required: Statement of Purpose (thoughtful, well-written; demonstrates ability to overcome challenges, dedication to goals, creativity, understanding of physics/astronomy, research potential), 3 letters of recommendation (capacity for research is most important criterion), transcripts (unofficial accepted at application; official required upon admission), TOEFL/IELTS for international, $75 fee (waivable)."},
        "tui": "JHU Physics PhD students typically receive multi-year fully-funded support through Research Assistantships, Teaching Assistantships, and fellowships, including tuition, stipend, and health insurance. The William H. Miller III Department combines world-renowned faculty and state-of-the-art facilities with more intimate learning environment typical of small liberal arts colleges. Research strengths in astronomy, condensed matter physics, particle physics, plasma spectroscopy. Note: PhD Program offers flexibility in choosing course of research and designing path through program. Note: Astronomy and Astrophysics PhD is a separate doctoral program in same department - this entry is Physics PhD.",
        "url": "details/jhu-physics-phd.html",
    },
]

DETAIL_TEMPLATE = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{school} - {en}</title>
<style>
body{{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;max-width:960px;margin:24px auto;padding:0 20px;color:#222;line-height:1.6}}
h1{{font-size:24px;border-bottom:2px solid #1a73e8;padding-bottom:8px}}
h2{{font-size:18px;color:#1a73e8;margin-top:24px}}
.card{{background:#f8f9fa;border-left:4px solid #1a73e8;padding:12px 16px;margin:12px 0;border-radius:4px}}
.meta{{display:grid;grid-template-columns:120px 1fr;gap:6px 12px;font-size:14px}}
.meta b{{color:#555}}
ul{{margin:6px 0;padding-left:20px}}
.note{{background:#fff3cd;border-left-color:#ffc107;padding:10px 14px;margin-top:16px;font-size:13px}}
a{{color:#1a73e8}}
</style>
</head>
<body>
<h1>{school} - {en}</h1>
<div class="card">
<div class="meta">
<b>Degree</b><span>{deg}</span>
<b>Level</b><span>Research Doctorate (PhD)</span>
<b>STEM</b><span>{stem_label}</span>
<b>Duration</b><span>{dur}</span>
<b>Deadline</b><span>{ddl}</span>
<b>Language</b><span>{lang}</span>
<b>Standardized</b><span>{test_cls}</span>
<b>Funding</b><span>{tui}</span>
</div>
</div>

<h2>Program Overview</h2>
<div class="card">
{overview}
</div>

<h2>Admissions Requirements</h2>
<div class="card">
{requirements}
</div>

<h2>Research Areas</h2>
<div class="card">
{research}
</div>

<h2>Official Source</h2>
<div class="card">
{source}
</div>

<div class="note">
<strong>Note:</strong> Sixth batch of Physics PhD sweep (UNC, Northwestern, Georgetown, UPenn, JHU). Key finding: sixth tier fully GRE-free - UNC and Georgetown explicitly waive both General and Subject; Northwestern splits (Physics optional, Astronomy not accepted); UPenn and JHU optional. Important distinctions: (1) UNC Physics & Astronomy requires SOP at least one page; TOEFL iBT 95; ETS 5816 no dept code; expected NC residency by Year 2; 4 DWE1 + 4 electives. (2) Northwestern Physics PhD deadline January 1, 2027 (later than typical); Astronomy PhD deadline December 15, 2026 with GRE scores NOT accepted; Applied Physics PhD also available. (3) Georgetown Physics has two tracks - Standard Physics Track and Industrial Leadership in Physics Track; 3 lab rotations; Annual Progress Report by September 15; no Duolingo since July 2021; TOEFL iBT 100 (new scale from Jan 21, 2026). (4) UPenn Physics & Astronomy December 8, 2026 11:59pm EST; ~12% admission rate; Fall only no spring; 5-year typical. (5) JHU Physics is in William H. Miller III Department; Astronomy & Astrophysics PhD is separate; TOEFL iBT 100 preferred (600 paper / 250 computer); $75 fee waivable.
</div>
</body>
</html>
"""

PAGES = {
    "unc-physics-phd": {
        "school": "UNC Chapel Hill, College of Arts and Sciences, Department of Physics and Astronomy",
        "en": "PhD in Physics",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Physics / CIP 40.0801; Astronomy / CIP 40.0201)",
        "dur": "Typically 5-6 years; 4 DWE1 courses + 4 electives; thesis proposal presentation; thesis defense (~45-min open dept presentation + closed committee exam); dissertation submitted 2 weeks before defense; on-campus (Chapel Hill, NC); Fall admission primarily",
        "ddl": "Fall 2027: **Deadline December 1, 2026**. Applications handled by UNC Graduate School; review begins late December. UNC Graduate School recommends December 15 for full fellowship consideration, but Physics program deadline is December 1.",
        "lang": "TOEFL iBT minimum 95 for non-native English speakers. ETS institution code 5816 (no department code). Test scores official and no more than 5 years old.",
        "test_cls": "GRE GENERAL NOT REQUIRED; GRE PHYSICS SUBJECT NOT REQUIRED (UNC Physics FAQ: 'The General GRE test is not required. The Physics GRE subject test is not required.' ETS 5816 no dept code. SOP at least 1 page; CV; research output, awards, leadership listed).",
        "tui": "Multi-year fully-funded through RA/TA/fellowship: tuition + stipend + health insurance. All eligible students expected to acquire NC residency by Year 2 (department pays tuition on student's behalf). Research: biophysics, medical physics, condensed matter, materials, nanotechnology, nuclear, neutrino, QFT, particle, GR, astrophysics.",
        "overview": "The University of North Carolina at Chapel Hill Department of Physics and Astronomy, within the College of Arts and Sciences, offers graduate work leading to the degrees of Master of Science and Doctor of Philosophy. The active fields of research include biophysics, medical physics, condensed-matter physics, materials physics, nanotechnology, nuclear physics, neutrino physics and nuclear astrophysics, quantum field theory, theoretical particle physics, general relativity and gravitation, extragalactic and stellar astronomy, and astrophysics. The graduate courses are designed to give students a broad foundation and introduce them to special fields in which the research interests of the department lie. The general regulations of The Graduate School govern work for the degrees of MS and PhD. To begin a graduate program in physics or astrophysics, the student should have completed most of the requirements for the degree of bachelor of science with a major in physics at the University, or their equivalent elsewhere. The minimum prerequisite for graduate study consists of basic undergraduate courses: PHYS 118 Introductory Calculus-based Mechanics and Relativity (4 hrs), PHYS 119 Introductory Calculus-based Electromagnetism and Quanta (4 hrs), PHYS 311 Electromagnetism I (3 hrs), and others. CRITICAL POLICY per Department FAQ: The General GRE test is not required. The Physics GRE subject test is not required. The minimum acceptable TOEFL iBT score is 95 for non-native English speakers. Required materials: Statement of Purpose of at least one page explaining past academic, research, and leadership activities (specifically how applicant will contribute to graduate and research program); Resume/CV containing information about all activities relevant for success as graduate student (research, outreach, leadership, teaching, extracurricular), research output (publications, presentations, posters), and awards/recognitions. Per the graduate degree timeline: required course work consists of four DWE1 courses plus four electives. PHYS 631, PHYS 632, and any courses in Physics and Astronomy at the 700-level or above (except PHYS 510, 885, 901, 992, 994) count as electives. Any other courses below 700 or in other departments require approval by Director of Graduate Studies. Minimum residence requirement for doctorate must be fulfilled by end of semester in which thesis proposal is presented. Thesis defense consists of ~45-minute presentation open to Department and closed exam session with thesis committee. Two weeks before scheduled defense date, student must submit dissertation to committee and advertise defense department-wide via email to physics-all and by getting defense on departmental calendar. Per the department: all eligible students are expected to acquire North Carolina residency status for tuition purposes by beginning of their second year; since department pays tuition on student's behalf, in-state vs out-of-state tuition difference can amount to $17,000+ per year. The application deadline for Fall semester 2027 enrollment is December 1, 2026; review of completed applications begins late December. Applications handled by UNC Graduate School. Email questions about application process may be directed to the graduate program office. The department is located in Chapel Hill, North Carolina.",
        "requirements": "<ul><li>Bachelor's degree in physics or equivalent (most BS requirements completed)</li><li>GRE General: NOT required</li><li>GRE Physics Subject: NOT required</li><li>TOEFL iBT minimum 95 for non-native English speakers</li><li>ETS institution code 5816 (no department code)</li><li>Test scores official and no more than 5 years old</li><li>UNC Graduate School online application</li><li>Statement of Purpose at least one page (past academic/research/leadership; how applicant will contribute to graduate/research program)</li><li>Resume/CV (research, outreach, leadership, teaching, extracurricular, publications/presentations/posters, awards/recognitions)</li><li>Transcripts</li><li>**Deadline December 1, 2026**</li><li>Review begins late December</li><li>Fall admission primarily</li><li>Required course work: 4 DWE1 courses + 4 electives</li><li>PHYS 631, PHYS 632, 700+ level count as electives</li><li>Courses below 700 or in other departments require DGS approval</li><li>Thesis proposal presentation (minimum residence fulfilled by end of semester)</li><li>Thesis defense: ~45-min open dept presentation + closed committee exam</li><li>Dissertation submitted 2 weeks before defense</li><li>All eligible students expected to acquire NC residency by Year 2</li><li>Multi-year fully-funded (RA/TA/fellowship)</li><li>On-campus residential (Chapel Hill, NC)</li></ul>",
        "research": "<ul><li>Biophysics</li><li>Medical physics</li><li>Condensed-matter physics</li><li>Materials physics</li><li>Nanotechnology</li><li>Nuclear physics</li><li>Neutrino physics and nuclear astrophysics</li><li>Quantum field theory</li><li>Theoretical particle physics</li><li>General relativity and gravitation</li><li>Extragalactic and stellar astronomy</li><li>Astrophysics</li></ul>",
        "source": '<a href="https://physics.unc.edu/graduate/" target="_blank">UNC Physics & Astronomy Graduate (application deadline December 1, 2026; review begins late December; General GRE not required; Physics GRE not required; TOEFL iBT minimum 95; SOP at least one page; CV; applications handled by UNC Graduate School)</a> | <a href="https://catalog.unc.edu/graduate/schools-departments/physics-astronomy/" target="_blank">UNC Catalog: Department of Physics and Astronomy (MS and PhD degrees; active fields biophysics, medical physics, condensed matter, materials, nanotechnology, nuclear, neutrino, QFT, theoretical particle, GR, extragalactic/stellar astronomy, astrophysics; prerequisite undergraduate courses PHYS 118/119/311)</a> | <a href="https://gradschool.unc.edu/admissions/instructions.html" target="_blank">UNC Graduate School Instructions (ETS institution code #5816 no department code; test scores current and no more than 5 years old; numeric score in all sections of GRE; scores kept on file for one year after term; recommend international applicants submit by December 1)</a> | <a href="https://gradschool.unc.edu/admissions/deadlines/" target="_blank">UNC Graduate School Deadlines (application closes 11:59pm ET on posted deadline; recommend complete applications by December 15 for full fellowship consideration; program-specific deadline supersedes recommended fellowship date if earlier; spring residential no applications after October 13, 2027; summer no applications after March 9, 2027)</a>',
    },
    "nu-physics-phd": {
        "school": "Northwestern University, Weinberg College of Arts and Sciences, Department of Physics and Astronomy",
        "en": "PhD in Physics",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Physics / CIP 40.0801)",
        "dur": "Typically 5-6 years; first-year students typically supported by 12-month fellowships (rotate and choose advisor); advanced coursework; research leading to dissertation; opportunities at off-campus facilities (CERN, astronomical observatories); on-campus (Evanston, IL); Fall admission",
        "ddl": "Fall 2027: **Physics PhD deadline January 1, 2027** (Astronomy PhD deadline December 15, 2026). Applications open September 15, 2026. Application fee $95. Decisions beginning mid-February.",
        "lang": "TOEFL iBT minimum 90 for PhD applicants per The Graduate School. International students required to submit TOEFL scores. ETS institution code for Northwestern. Official scores required upon matriculation.",
        "test_cls": "GRE GENERAL OPTIONAL; GRE PHYSICS SUBJECT OPTIONAL for Physics PhD (Northwestern: 'For students applying to the Physics PhD program for fall 2027, GRE (General and Physics) scores are optional.' CRITICAL: Astronomy PhD scores NOT accepted. Master's optional. At least 2 LOR from professors familiar with work; SOP; transcripts.)",
        "tui": "Fully funded. First-year students typically supported by 12-month fellowships (rotate before committing to advisor). Multi-disciplinary research with joint faculty in Materials Science, Chemistry, EEE; strong ties to Argonne National Laboratory and Fermilab; opportunities at CERN or astronomical observatories.",
        "overview": "The Northwestern University Department of Physics and Astronomy, within the Weinberg College of Arts and Sciences, offers two different PhD degrees designed to best train students in their chosen discipline. For most branches of physics, students should enroll in the Physics PhD. Students interested in astronomy or astrophysics may apply for the Astronomy PhD. Students interested in Applied Physics may apply for the Applied Physics PhD. CRITICAL POLICY per department page: For students applying to the Physics PhD program for fall 2027, GRE (General and Physics) scores are optional. For students applying to the Astronomy PhD program for fall 2027, GRE (General and Physics) scores are not accepted. For students applying to the Master's program for fall 2027, GRE (General and Physics) scores are optional. The application deadline for Physics PhD is January 1, 2027; for Astronomy PhD is December 15, 2026. Applications open September 15, 2026. The application fee is $95 paid in application portal. Decisions will be made beginning in mid-February. At least two letters of recommendation from professors familiar with the student's work must be submitted through application portal; professors will be sent an email through which they can submit their letters. Statement of Purpose required. International students are required to submit scores from tests such as TOEFL. The Graduate School minimum TOEFL score is 90 for PhD applicants. CRITICAL FUNDING: PhD students are fully funded. First-year students are typically supported by 12-month fellowships, which gives opportunity to rotate through research groups and choose research advisor. The department is particularly strong in multi-disciplinary research, with joint faculty in Materials Science, Chemistry, and Electrical Engineering, and strong ties to both Argonne National Laboratory and Fermi National Accelerator Laboratory. Students in certain areas may have the opportunity to spend significant amounts of time at off-campus facilities such as CERN or at astronomical observatories around the world. The department is located in Evanston, Illinois. Note: this entry is Physics PhD; Astronomy PhD (deadline December 15, 2026; GRE scores NOT accepted) and Applied Physics PhD are separate programs in the same department.",
        "requirements": "<ul><li>Bachelor's degree in physics or related quantitative field</li><li>GRE General: optional for Physics PhD</li><li>GRE Physics Subject: optional for Physics PhD</li><li>CRITICAL: GRE scores NOT accepted for Astronomy PhD</li><li>TOEFL iBT minimum 90 for PhD applicants</li><li>ETS institution code for Northwestern</li><li>The Graduate School application portal (applications open September 15, 2026)</li><li>Application fee $95</li><li>At least 2 letters of recommendation from professors familiar with work</li><li>Statement of Purpose</li><li>Transcripts</li><li>**Physics PhD deadline January 1, 2027**</li><li>Astronomy PhD deadline December 15, 2026</li><li>Decisions beginning mid-February</li><li>Fall admission</li><li>First-year students supported by 12-month fellowships (rotate and choose advisor)</li><li>Multi-disciplinary research: joint faculty in Materials Science, Chemistry, EEE</li><li>Ties to Argonne National Laboratory and Fermi National Accelerator Laboratory</li><li>Opportunities at CERN or astronomical observatories</li><li>Fully funded (RA/TA/fellowship)</li><li>On-campus residential (Evanston, IL)</li></ul>",
        "research": "<ul><li>Condensed matter physics</li><li>High energy physics</li><li>Biological physics</li><li>AMO physics</li><li>Astrophysics (separate Astronomy PhD track)</li><li>Applied physics (separate Applied Physics PhD track)</li><li>Multi-disciplinary research with Materials Science, Chemistry, EEE</li><li>Off-campus facilities: Argonne National Lab, Fermilab, CERN, astronomical observatories</li></ul>",
        "source": '<a href="https://physics.northwestern.edu/graduate/doctoral-program/admissions/" target="_blank">Northwestern Physics & Astronomy How to Apply (Fall 2027 applications open; Physics PhD deadline January 1, 2027; Astronomy PhD deadline December 15, 2026; application fee $95; GRE optional for Physics PhD; GRE not accepted for Astronomy PhD; decisions mid-February; TOEFL minimum 90 for PhD; at least 2 LOR; SOP; transcripts)</a> | <a href="https://physics.northwestern.edu/graduate/doctoral-program/" target="_blank">Northwestern Physics Doctoral Programs (two PhD degrees: Physics PhD for most branches; Astronomy PhD for astronomy/astrophysics; Applied Physics PhD also available; PhD students fully funded; first-year 12-month fellowships; joint faculty in Materials Science, Chemistry, EEE; ties to Argonne and Fermilab; opportunities at CERN/observatories)</a> | <a href="https://physics.northwestern.edu/graduate/doctoral-program/astronomy-phd-degree-requirement.html" target="_blank">Northwestern Astronomy PhD Degree (GRE exam scores NOT accepted; six 400-level astronomy courses; two 400-level physics courses including Phys 411-0 Classical Mechanics first quarter; four other 400-level quantitative science/engineering courses; CIERA center for interdisciplinary research)</a> | <a href="https://www.tgs.northwestern.edu/admission/application-procedures/application-deadlines.html" target="_blank">Northwestern The Graduate School Deadlines (applications for 2026-27 open September 15, 2026; deadlines vary by program; timely submission responsibility; recommend contacting recommenders early; departments vary on late/incomplete applications)</a>',
    },
    "geo-physics-phd": {
        "school": "Georgetown University, Graduate School of Arts and Sciences, Department of Physics",
        "en": "PhD in Physics",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Physics / CIP 40.0801)",
        "dur": "Typically 5-6 years; at least 34 credits graduate coursework; Integrative Experience after first two semesters; 3 lab rotations; B or better in first-year core OR comprehensive exam; Qualifying Exam; dissertation defense; Annual Progress Report by September 15; on-campus (Washington, DC); Fall admission",
        "ddl": "Fall 2027: **Deadline January 15, 2027** (11:59 PM EST). Application fee $90. All applications submitted electronically through Georgetown University Office of Graduate Admissions portal. Office will not accept credentials via email or fax.",
        "lang": "TOEFL iBT minimum 100 (original scale) or 5 on new TOEFL iBT scale beginning January 21, 2026; IELTS minimum 7.5. NOTE: Duolingo discontinued for Graduate Admissions effective July 2021. Minimum GPA 3.0 undergrad; master's expected GPA 3.5.",
        "test_cls": "GRE GENERAL WAIVED; GRE PHYSICS SUBJECT WAIVED for 2026-2027 cycle (Georgetown Physics: 'GRE scores will NOT be required this year, and their absence will not be used to count against any applicant.' Required: online application, $90 fee, transcripts from all undergrad/grad institutions, Resume/CV, 3 LOR.)",
        "tui": "Multi-year fully-funded through RA/TA/fellowship: tuition + stipend + health insurance. Two tracks: Standard Physics Track and Industrial Leadership in Physics Track. Faculty research sponsored by NSF, AFOSR, DOE. Close student-faculty interaction.",
        "overview": "The Georgetown University Department of Physics, within the Graduate School of Arts and Sciences, offers the Doctor of Philosophy (PhD) in Physics. The Physics Department is a vibrant community of faculty, students, and staff committed to Georgetown's mission as a student-centered research university. The academic programs feature close student-faculty interactions and include the novel Industrial Leadership in Physics track for doctoral students. Faculty-led research groups work in areas such as Biological Physics, Hard Condensed Matter, Micro and Nano Technologies, Optics and Imaging, Physics Education, Soft Condensed Matter, Statistical Physics and Ultracold Gases, sponsored by grants from government agencies such as the National Science Foundation, the Air Force Office of Scientific Research, and the Department of Energy. CRITICAL POLICY per Department prospective students page: Important notice regarding the General and Physics GRE requirement for the 2026-2027 application cycle: GRE scores will NOT be required this year, and their absence will not be used to count against any applicant. A completed application consists of (1) an online application form, (2) an application fee ($90), and the following credentials: Graduate Record Exam (GRE) General test (waived for 2026-2027 admission cycle), GRE Physics Subject test (waived for 2026-2027 admission cycle), Transcripts (official copies from all undergraduate and graduate institutions attended), Resume or curriculum vitae (CV), 3 letters of recommendation. The application deadline for the PhD Program is January 15. The application deadline for the MS Program is May 1. All applications to the Graduate Physics Program should be submitted electronically through the Georgetown University Office of Graduate Admissions application portal. The Office of Graduate Admissions will not accept any credentials via email or fax. Per the Graduate School FAQ: minimum GPA 3.0 in accredited undergraduate program. Minimum TOEFL iBT score 100 (original scale) or 5 on new TOEFL iBT scale beginning January 21, 2026; IELTS minimum 7.5. Georgetown University has discontinued use of Duolingo English Test for Graduate Admissions, effective July 2021. Per the Georgetown Bulletin: To receive the PhD in Physics, students must complete: 34 credits of coursework; Participate in Integrative Experience after first two semesters of coursework; Complete 3 lab rotations; Receive a final grade of B or better in each first-year core course OR pass a comprehensive examination; Pass the Qualifying Examination; Research, write, and defend a dissertation. Students are also expected to submit an Annual Progress Report by September 15 detailing their work over the previous year. Students select one of two tracks: Standard Physics Track or Industrial Leadership Track. The department is located in Washington, DC.",
        "requirements": "<ul><li>Bachelor's degree in physics or related quantitative field</li><li>Minimum GPA 3.0 in accredited undergraduate program</li><li>GRE General: waived for 2026-2027 cycle</li><li>GRE Physics Subject: waived for 2026-2027 cycle</li><li>Absence of GRE will not count against applicant</li><li>TOEFL iBT minimum 100 (original) or 5 on new scale from Jan 21, 2026</li><li>IELTS minimum 7.5</li><li>Duolingo NOT accepted (discontinued July 2021)</li><li>Georgetown University Office of Graduate Admissions application portal (electronic only)</li><li>Application fee $90</li><li>Transcripts (official copies from all undergrad/grad institutions)</li><li>Resume/CV</li><li>3 letters of recommendation</li><li>**Deadline January 15, 2027** (11:59 PM EST)</li><li>MS deadline May 1</li><li>Fall admission</li><li>Two tracks: Standard Physics Track / Industrial Leadership in Physics Track</li><li>At least 34 credits of graduate coursework</li><li>Integrative Experience after first two semesters</li><li>3 lab rotations</li><li>B or better in each first-year core course OR pass comprehensive examination</li><li>Qualifying Examination</li><li>Annual Progress Report by September 15</li><li>Dissertation research, writing, and defense</li><li>Multi-year fully-funded (RA/TA/fellowship)</li><li>On-campus residential (Washington, DC)</li></ul>",
        "research": "<ul><li>Biological physics</li><li>Hard condensed matter physics</li><li>Soft condensed matter physics</li><li>Micro and nano technologies</li><li>Optics and imaging</li><li>Physics education</li><li>Statistical physics</li><li>Ultracold gases</li><li>Interdisciplinary research sponsored by NSF, AFOSR, DOE</li></ul>",
        "source": '<a href="https://physics.georgetown.edu/prospective-students-and-applicants/" target="_blank">Georgetown Physics Prospective Students (PhD deadline January 15; MS deadline May 1; GRE General and Physics Subject waived for 2026-2027 cycle; absence not counted against; $90 fee; transcripts; CV; 3 LOR; electronic application only; no credentials via email/fax)</a> | <a href="https://physics.georgetown.edu/prospective-students-and-applicants/faqs/" target="_blank">Georgetown Physics FAQ (minimum GPA 3.0; TOEFL iBT 100 original or 5 on new scale from Jan 21, 2026; IELTS 7.5; Duolingo discontinued July 2021; Physics GRE waived; application deadline January 15)</a> | <a href="https://grad.georgetown.edu/physics/" target="_blank">Georgetown Graduate School: Physics (PhD requires at least 34 credits graduate coursework; MS requires 37 credits non-thesis or 31 credits thesis; TOEFL 100/IELTS 7.5; 3 LOR; Academic SOP; optional Statement on Diversity; Fall deadline January 15)</a> | <a href="https://bulletin.georgetown.edu/programs/physics-phd/" target="_blank">Georgetown Bulletin: Physics PhD (34 credits coursework; Integrative Experience after first two semesters; 3 lab rotations; B or better first-year core OR comprehensive exam; Qualifying Exam; dissertation defense; Annual Progress Report by September 15; two tracks Standard Physics / Industrial Leadership; research Biological Physics/Hard Condensed Matter/Micro-Nano/Optics/Physics Education/Soft Condensed Matter/Statistical/Ultracold Gases)</a>',
    },
    "up-physics-phd": {
        "school": "University of Pennsylvania, School of Arts and Sciences, Department of Physics and Astronomy",
        "en": "PhD in Physics and Astronomy",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Physics / CIP 40.0801; Astronomy / CIP 40.0201)",
        "dur": "Typically 5 years; short term of coursework followed by independent original research forming basis of dissertation; rich seminars and colloquia; typical preparation intermediate/advanced mechanics, E&M, QM, undergraduate lab; on-campus (Philadelphia, PA); Fall admission only",
        "ddl": "Fall 2027: **Deadline December 8, 2026 at 11:59 PM EST** for full consideration by Admissions Committee. Application opens October 1, 2026. Application fee $90. Physics and Astronomy only enrolls new students for Fall semester (no spring admission).",
        "lang": "TOEFL required for international students (native language not English). Per historical FAQ, TOEFL computer-based minimum 100. Test scores valid 2 years. Official scores required upon matriculation.",
        "test_cls": "GRE NOT REQUIRED (UPenn Physics & Astronomy: 'GRE exams are not required for Fall 2026 admissions.' Submitted GRE scores may provide supplementary info; applicants who feel GRE demonstrates an ability not shown otherwise may note this in research/personal statement. Required: 3 LOR, undergrad transcript, grad transcript if applicable, personal statement. No minimum GRE V/Q specified.)",
        "tui": "Multi-year fully-funded through RA/TA/fellowship: tuition + stipend + health insurance. ~12% admission rate. World-leading department; students combine short coursework with independent original research forming dissertation basis and typically first publications. Rich seminars/colloquia.",
        "overview": "The University of Pennsylvania Department of Physics and Astronomy, within the School of Arts and Sciences, offers the Doctor of Philosophy (PhD) in Physics and Astronomy. The University of Pennsylvania Department of Physics and Astronomy is a world-leading institution that generally is regarded as among the very best places for graduate students to obtain a PhD. Graduate students at Penn combine a short term of coursework with independent, original research that forms the basis of their dissertation and typically their first publications. A rich program of seminars and colloquia by invited speakers from across the world supplements what students learn in classes and during their research. Primary research areas include outstanding theoretical and experimental work in astrophysics and cosmology, nuclear and particle physics, condensed matter, and AMO. Our Astrophysics and Cosmology groups explore the structure and evolution of the Universe, perform searches for exoplanets, and study galaxy formation. Efforts in cosmology include theoretical models for the acceleration of the Universe and the properties of dark matter, observations of the structure of the Universe and studies of dark matter using gravitational lensing with the Dark Energy Survey and eventually the Large-aperture Synoptic Survey Telescope, and studies of the cosmic microwave background with telescopes in places like the Chilean Andes and the South Pole. Our effort in nuclear and particle physics also spans both fundamental theoretical work such as string theory, as well as experimental work at the Large Hadron Collider at CERN and various neutrino experiments across the world. Collider efforts include studies of the recently-discovered Higgs boson as well as searches for supersymmetry, and our neutrino work includes searches for Majorana neutrinos and CP violation in neutrino oscillations. CRITICAL POLICY per Department FAQ: Applications should be submitted by December 8, 2026 at 11:59 PM EST for full consideration by the Admissions Committee. The application fee is $90.00. GRE exams are not required for Fall 2026 admissions. We require three letters of recommendation, an undergraduate transcript, and a graduate transcript if applicable. The TOEFL exam is required for international students. A personal statement is required. Physics and Astronomy only enrolls new students for the Fall semester - no spring admission. Special Admissions Requirements: Successful applicants will usually have a Bachelor's degree in physics, astronomy, or a related science, as well as prior research experience. For applicants whose native language is not English, the TOEFL exam is required to demonstrate proficiency in English. We do not require GRE scores as part of our admissions process, but like many other items of a student's application - transcript, letters, statement - they may provide information about you as a student that might otherwise be missed. If you have chosen to take the GREs and feel that they demonstrate an ability that is not shown otherwise by your record, please note this in your research or personal statements. In the personal statement, all PhD applications within the Graduate Division of Arts & Sciences should address the following prompts. Admission statistics: Graduate application fee required $90; admission deadline (Fall admission) December 8, 2026 at 11:59 PM EST; we typically make offers of admission to about 12 percent of those who apply; undergraduate preparation assumed: an undergraduate degree in physics, astronomy, or a related science. A typical student will have completed intermediate and advanced courses in mechanics, electricity and magnetism, quantum mechanics, and undergraduate laboratory courses. The department is located in Philadelphia, Pennsylvania.",
        "requirements": "<ul><li>Bachelor's degree in physics, astronomy, or related science</li><li>Prior research experience expected</li><li>Typical preparation: intermediate and advanced courses in mechanics, E&M, QM, undergraduate laboratory courses</li><li>GRE: NOT required (Fall 2026+)</li><li>Submitted GRE scores may provide supplementary info; may be noted in research/personal statement</li><li>No minimum GRE V/Q specified</li><li>TOEFL required for international students (native language not English)</li><li>TOEFL scores valid 2 years</li><li>3 letters of recommendation</li><li>Undergraduate transcript</li><li>Graduate transcript if applicable</li><li>Personal statement (addressing Graduate Division of Arts & Sciences prompts)</li><li>Application fee $90</li><li>**Deadline December 8, 2026 at 11:59 PM EST**</li><li>Application opens October 1, 2026</li><li>Fall admission only (no spring admission)</li><li>~12% admission rate</li><li>5-year typical</li><li>Multi-year fully-funded (RA/TA/fellowship)</li><li>On-campus residential (Philadelphia, PA)</li></ul>",
        "research": "<ul><li>Astrophysics and cosmology (universe structure/evolution, exoplanets, galaxy formation, dark matter, CMB, Dark Energy Survey, LSST, Chilean Andes, South Pole telescopes)</li><li>Nuclear and particle physics (string theory, LHC at CERN, Higgs boson, supersymmetry, neutrino Majorana/CP violation)</li><li>Condensed matter physics</li><li>Atomic, molecular, and optical physics</li><li>Interdisciplinary research with Penn departments of astronomy, physics, engineering, and related sciences</li></ul>",
        "source": '<a href="https://www.physics.upenn.edu/graduate/admissions" target="_blank">UPenn Physics & Astronomy Admissions (application deadline December 8, 2026 11:59pm EST; $90 fee; GRE not required; TOEFL required for international; 3 LOR; undergrad/grad transcript; personal statement; ~12% admission; Fall only no spring; typical prep mechanics/E&M/QM/undergrad lab)</a> | <a href="https://catalog.upenn.edu/graduate/programs/physics-astronomy-phd/" target="_blank">UPenn Catalog: Physics and Astronomy PhD (world-leading graduate program; short coursework + independent original research; rich seminars/colloquia; astrophysics/cosmology exoplanets/galaxy formation/dark matter/CMB; nuclear/particle string theory/LHC/Higgs/supersymmetry/neutrino)</a> | <a href="https://www.physics.upenn.edu/graduate" target="_blank">UPenn Physics Graduate Program (application opens October 1; apply through apply.graduateadmissions.upenn.edu; December 8 deadline; typical admission 12%; no spring admission; personal statement required)</a>',
    },
    "jhu-physics-phd": {
        "school": "Johns Hopkins University, Zanvyl Krieger School of Arts and Sciences, William H. Miller III Department of Physics and Astronomy",
        "en": "PhD in Physics",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Physics / CIP 40.0801)",
        "dur": "Typically 5-6 years; flexible choice of course of research and path through program; leading to dissertation; on-campus residential (Baltimore, MD); September (Fall) admission",
        "ddl": "Fall 2027 (September matriculation): **Deadline December 15, 2026** per Department admissions. All applications submitted online through Graduate Admissions portal. Application fee $75 (non-refundable; may be waived). Note: this entry is Physics PhD; Astronomy and Astrophysics PhD is separate.",
        "lang": "TOEFL iBT minimum 100 preferred (equivalent to 600 paper-based or 250 computer-based); IELTS also accepted. A reproduction (photocopy) acceptable at application; official scores required upon admission. ETS institution code for Johns Hopkins University.",
        "test_cls": "GRE GENERAL OPTIONAL; GRE PHYSICS SUBJECT OPTIONAL (JHU e-Catalogue 2026-27: 'submission of General GRE and Physics GRE scores is optional.' Required: SOP (thoughtful, well-written; demonstrates ability to overcome challenges, dedication, creativity, understanding of physics/astronomy, research potential), 3 LOR (capacity for research is most important criterion), transcripts (unofficial accepted at application; official required upon admission), TOEFL/IELTS, $75 fee waivable.)",
        "tui": "Multi-year fully-funded through RA/TA/fellowship: tuition + stipend + health insurance. William H. Miller III Department combines world-renowned faculty and state-of-the-art facilities with intimate learning environment. Research: astronomy, condensed matter, particle, plasma spectroscopy.",
        "overview": "The Johns Hopkins University William H. Miller III Department of Physics and Astronomy, within the Zanvyl Krieger School of Arts and Sciences, offers the Doctor of Philosophy (PhD) in Physics. With its world-renowned faculty and state-of-the-art facilities, the William H. Miller III Department of Physics and Astronomy combines the best aspects of a top research university with the more intimate learning environment typical of small liberal arts colleges. Degrees offered: BA, BS, BA/MA, BS/MA, PhD. Graduate students have flexibility in choosing their course of research and designing their path through the program. Whether your interest is in astronomy, condensed matter, particle physics, or plasma spectroscopy, you'll find state-of-the-art tools at your disposal. CRITICAL POLICY per Department Admissions and Transfers page: The application deadline for students wishing to matriculate in September is the preceding December 15. All applications must be submitted online through the Graduate Admissions portal. A complete application will include: Statement of purpose (thoughtful, well-written statement that shows the ability to overcome challenges, dedication to attain chosen goals, a capacity for creativity, an understanding of physics and/or astronomy, and any other indication of potential for research); Three letters of recommendation (recommendation letters should help us evaluate your capacity for research, the most important criterion for admission); Transcripts of all previous work (transcripts submitted with the application may be unofficial; successful applicants who accept the offer of admission must supply an official transcript before they can begin the PhD program at JHU; in the case of students in the final year of their bachelors program, the official transcript must show completion of all coursework required for the degree); TOEFL or IELTS for international students (a reproduction is acceptable; Johns Hopkins prefers a minimum score of 600 paper-based or 250 computer-based or 100 internet-based on the TOEFL); $75 non-refundable application fee (may be waived). Per the JHU e-Catalogue 2026-27: Note: submission of General GRE and Physics GRE scores is optional. Successful applicants applying in the last year of their bachelor's program will need to demonstrate the completion of their bachelor's degree before they can begin the PhD program at JHU. Note: the department also offers a separate Astronomy and Astrophysics PhD doctoral program in the same department - this entry is Physics PhD, NOT Astronomy and Astrophysics PhD. The department is located in Baltimore, Maryland.",
        "requirements": "<ul><li>Bachelor's degree in physics or related quantitative field</li><li>Successful applicants applying in last year of bachelor's must demonstrate completion before matriculation</li><li>GRE General: optional</li><li>GRE Physics Subject: optional</li><li>TOEFL iBT minimum 100 preferred (600 paper / 250 computer)</li><li>IELTS also accepted</li><li>Reproduction (photocopy) acceptable at application; official required upon admission</li><li>ETS institution code for Johns Hopkins University</li><li>Krieger School Graduate Admissions online application</li><li>Statement of Purpose (thoughtful, well-written; ability to overcome challenges, dedication, creativity, understanding of physics/astronomy, research potential)</li><li>3 letters of recommendation (capacity for research is most important criterion)</li><li>Transcripts (unofficial at application; official required upon admission)</li><li>Application fee $75 (non-refundable; may be waived)</li><li>**Deadline December 15, 2026** for September matriculation</li><li>Fall (September) admission</li><li>Flexible course of research and path through program</li><li>Multi-year fully-funded (RA/TA/fellowship)</li><li>Separate from Astronomy and Astrophysics PhD in same department</li><li>On-campus residential (Baltimore, MD; Homewood Campus)</li></ul>",
        "research": "<ul><li>Astronomy and astrophysics (separate Astronomy PhD track)</li><li>Condensed matter physics</li><li>Particle physics</li><li>Plasma spectroscopy</li><li>Atomic, molecular, and optical physics</li><li>Interdisciplinary research with JHU departments of engineering, applied physics laboratory, medicine</li></ul>",
        "source": '<a href="https://physics-astronomy.jhu.edu/graduate/admissions/" target="_blank">JHU Physics & Astronomy Admissions (September matriculation deadline December 15; online application through Graduate Admissions portal; SOP; 3 LOR (capacity for research most important); transcripts unofficial at application official upon admission; TOEFL/IELTS preferred 100 iBT/600 paper/250 computer; $75 fee may be waived)</a> | <a href="https://e-catalogue.jhu.edu/arts-sciences/full-time-residential-programs/degree-programs/physics-astronomy/physics-phd/" target="_blank">JHU e-Catalogue: Physics PhD (submission of General GRE and Physics GRE scores is optional; SOP; 3 LOR; transcripts; TOEFL/IELTS; $75 fee waivable; successful applicants in final year of bachelor must demonstrate completion before matriculation)</a> | <a href="https://physics-astronomy.jhu.edu/" target="_blank">JHU William H. Miller III Department of Physics & Astronomy (world-renowned faculty + state-of-the-art facilities; intimate learning environment; degrees BA/BS/BA-MA/BS-MA/PhD; research astronomy, condensed matter, particle, plasma spectroscopy; flexible PhD research path)</a> | <a href="https://e-catalogue.jhu.edu/arts-sciences/full-time-residential-programs/degree-programs/physics-astronomy/astronomy-astrophysics-phd/" target="_blank">JHU e-Catalogue: Astronomy and Astrophysics PhD (SEPARATE doctoral program in same department; 3 LOR; transcripts; TOEFL/IELTS; $75 fee waivable; General GRE and Physics GRE scores optional; NOT this entry - this entry is Physics PhD)</a>',
    },
}

# Write detail pages
for p in PROGRAMS:
    key = p["id"]
    d = PAGES[key]
    html = DETAIL_TEMPLATE.format(
        school=d["school"], en=d["en"], deg=d["deg"], stem_label=d["stem_label"],
        dur=d["dur"], ddl=d["ddl"], lang=d["lang"], test_cls=d["test_cls"], tui=d["tui"],
        overview=d["overview"], requirements=d["requirements"],
        research=d["research"], source=d["source"],
    )
    path = os.path.join(DET, key + ".html")
    with open(path, "w", encoding="utf-8") as f:
        f.write(html)
    print(f"Wrote: {key}.html")

# Append PROGRAMS
idx_path = os.path.join(BASE, "index_main.html")
with open(idx_path, "r", encoding="utf-8") as f:
    html = f.read()

def build_entry(p):
    return ('{{id:"{id}",s:"{s}",n:"{n}",en:"{en}",deg:"{deg}",lvl:"{lvl}",stem:{stem},'
            'dur:"{dur}",ddl:"{ddl}",lang:"{lang}",test:{{cls:"{test_cls}"}},'
            'tui:"{tui}",url:"{url}"}}').format(
        id=p["id"], s=p["s"], n=p["n"], en=p["en"], deg=p["deg"], lvl=p["lvl"],
        stem=p["stem"], dur=p["dur"], ddl=p["ddl"], lang=p["lang"],
        test_cls=p["test"]["cls"].replace('"', "'"),
        tui=p["tui"].replace('"', "'"), url=p["url"],
    )

new_entries = ",\n".join(build_entry(p) for p in PROGRAMS)

m = re.search(r'const\s+PROGRAMS\s*=\s*\[', html)
start = m.end()
depth = 1
i = start
while i < len(html) and depth > 0:
    c = html[i]
    if c == '[': depth += 1
    elif c == ']': depth -= 1
    i += 1
insert_pos = i - 1
prefix = html[:insert_pos].rstrip()
suffix = html[insert_pos:]
if prefix.endswith('{'):
    new_block = prefix + "\n" + new_entries + "\n" + suffix
else:
    new_block = prefix + ",\n" + new_entries + "\n" + suffix

# Append VD on new_block (re-locate to avoid offset)
vd_entries = ",\n".join(f'"{p["url"]}"' for p in PROGRAMS)
m2 = re.search(r'VERIFIED_DETAILS\s*=\s*new\s+Set\s*\(\s*\[', new_block)
vstart = m2.end()
vdepth = 1
j = vstart
while j < len(new_block) and vdepth > 0:
    c = new_block[j]
    if c == '[': vdepth += 1
    elif c == ']': vdepth -= 1
    j += 1
vinsert_pos = j - 1
vprefix = new_block[:vinsert_pos].rstrip()
vsuffix = new_block[vinsert_pos:]
if vprefix.endswith(','):
    new_block = vprefix + "\n" + vd_entries + "\n" + vsuffix
elif vprefix.endswith('['):
    new_block = vprefix + "\n" + vd_entries + "\n" + vsuffix
else:
    new_block = vprefix + ",\n" + vd_entries + "\n" + vsuffix

with open(idx_path, "w", encoding="utf-8") as f:
    f.write(new_block)

print(f"Appended {len(PROGRAMS)} PROGRAMS entries and {len(PROGRAMS)} VD entries")
print(f"Done. File size: {os.path.getsize(idx_path)}")
