# -*- coding: utf-8 -*-
"""Round 258: batch add 5 Chemistry PhD (first tier: MIT / Stanford / Harvard / Princeton / Berkeley)
- MIT Chemistry PhD (Dec 1, 2026 11:59pm ET; GRE NOT accepted General and Subject; TOEFL 100/IELTS 7.0; $90 fee; 3 LOR; Personal statement 500-1000 words + Research statement 1000-1500 words; Fall only; 2+ years research advised; ETS 3514 dept 62; areas Chemical Biology/Inorganic/Materials/Organic/Physical/Theory)
- Stanford Chemistry PhD (Nov 30, 2026 - earlier than typical Dec 1; All GREs optional General and Subject; TOEFL 108/IELTS 8 - Chemistry dept minimum higher than University; $125 fee; 3 LOR; SOP; Fall only; no MS degree; fee waiver 10 business days before; ETS 4704 no dept)
- Harvard Chemistry and Chemical Biology PhD (Dec 1, 2026 5pm ET; GSAS 2026-07-01 policy Optional; TOEFL 80/IELTS 6.5; ETS 3451 no dept; SOP two sections Statement of Purpose <=300 words + Research Accomplishments <=500 words; Personal Statement required; areas Chemical Biology/Chemical Physics/Inorganic/Organic/Physical/Theory; 4 advanced courses; 5-6 years; PhD qualifying exam; research group by end of second term)
- Princeton Chemistry PhD (Dec 1, 2026 11:59pm EST; GRE General and Subject strongly recommended but not required; $75 fee; ETS 2672 no dept; 5-year; no second PhD in same/similar field; decisions by Feb 1; MS only for industrial associates employees; optional diversity statement <=500 words; select subplan + up to 5 faculty)
- Berkeley Chemistry PhD (Dec 1, 2026; GRE General REQUIRED no minimum; GRE Subject NOT required; ETS 4833 no dept; min GPA 3.0; Fall only; PhD only no terminal MS; 4-6 years; ~800 apps/year; 3 concentrations Physical/Synthetic/Chemical Biology; supplemental info also Dec 1)
Key finding: Chemistry PhD GRE policy splits across first tier - MIT NOT accepted, Stanford optional, Harvard GSAS policy optional (dept old FAQ outdated), Princeton strongly recommended but not required, Berkeley General REQUIRED (trend reversal - Berkeley continues to require GRE General in Chemistry).
"""
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": "mit-chem-phd",
        "s": "mit",
        "n": "化学博士",
        "en": "PhD in Chemistry (Massachusetts Institute of Technology, School of Science, Department of Chemistry; located in Cambridge, MA; no GRE accepted General or Subject; areas include Chemical Biology, Inorganic Chemistry, Materials, Organic Chemistry, Physical Chemistry, Theory; admissions interview by invitation after initial review)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 5-6 years; PhD and ScD awarded interchangeably by School of Science except in biology, cognitive science, neuroscience, medical engineering, medical physics; Fall only (September matriculation); on-campus residential (Cambridge, MA); students advised to have 2 or more years of research environment experience prior to applying",
        "ddl": "Fall 2027 (September matriculation): **Deadline December 1, 2026 at 11:59 PM Eastern Time** per MIT Department of Chemistry and Office of Graduate Education. Application opens September 15, 2026. Application fee $90.00. All application materials including letters of recommendation and all official test scores must be submitted by deadline; admissions decisions finalized in late January/early February. Test scores must be verified by test provider no later than February 1, 2027. No Spring admission.",
        "lang": "TOEFL iBT minimum 100 (minimum acceptable score per Department); IELTS minimum overall band 7.0. Required for applicants whose primary language is not English. ETS institution code 3514; department code 62. Minimum TOEFL 100 iBT or 5 (iBT26 new scale).",
        "test": {"cls": "GRE NOT ACCEPTED (MIT Department of Chemistry: 'GRE test scores are not accepted for applications. All applications will be given full consideration without reference to GRE scores, this includes both the general test and Chemistry subject test scores.' Required materials: online application, Personal Statement 500-1000 words, Research Statement 1000-1500 words, 3 letters of recommendation, transcripts (PDF upload; official only if admitted), English proficiency exam scores, Resume/CV. Admissions interview by invitation after initial faculty review. CAMP (Chemistry Undergraduate Program) deadline Nov 1, 2026 already closed."},
        "tui": "MIT Chemistry PhD students receive full funding package. Per MIT Student Financial Services: specific costs for tuition, fees, books, supplies, housing, food, transportation available on SFS website. Department of Chemistry does not offer application fee waivers for Fall 2027 admission cycle. Areas of research: Chemical Biology, Inorganic Chemistry, Materials, Organic Chemistry, Physical Chemistry, Theory. NSF GRFP eligible (Field of Study: Chemistry).",
        "url": "details/mit-chem-phd.html",
    },
    {
        "id": "stanford-chem-phd",
        "s": "stanford",
        "n": "化学博士",
        "en": "PhD in Chemistry (Stanford University, School of Humanities and Sciences, Department of Chemistry; located in Stanford, CA; no MS degree program; Chemistry department TOEFL minimum 108 higher than University 90; all GREs optional; fee waiver request must be submitted 10 business days before deadline)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 5-6 years; applications accepted from candidates who intend to pursue PhD degree only; no MS degree program; Fall (Autumn quarter) admission only; on-campus residential (Stanford, CA); research-focused with thesis",
        "ddl": "Fall 2027 (Autumn quarter matriculation): **Deadline Monday, November 30, 2026** per Stanford Department of Chemistry How to Apply. Application opens Tuesday, September 15, 2026. Application fee $125 for U.S. citizens, permanent residents, and international applicants. Fee waiver request must be submitted at least 10 business days (two weeks) before November 30, 2026 deadline to ensure timely decision. Required supporting materials may arrive after deadline but strongly recommended to complete application as close to deadline as possible.",
        "lang": "TOEFL iBT minimum 108 (taken before January 21, 2026) or 5.5 (taken on or after January 21, 2026 new scale) per Chemistry Department; IELTS Academic minimum overall band 8. Chemistry Department minimum is higher than Stanford University minimum (TOEFL 90 / IELTS 7). Required for international applicants not from country with English as official language or without 2+ consecutive years professional/educational experience using English. ETS institution code 4704; no department code needed.",
        "test": {"cls": "ALL GRES OPTIONAL (Stanford Department of Chemistry: 'All GREs are optional. Applicants may take the general GRE exams in the autumn prior to applying, or earlier.' Official GRE scores including general test and subject exam in chemistry are optional. Required materials: online application, 3 letters of recommendation (letters speaking to lab experience and scientific creativity and potential to work independently to solve research problems), Statement of Purpose (describe research projects/skills/experience and specifically research interests at Stanford with research group names), TOEFL or IELTS Academic scores, one uploaded unofficial transcript from each university attended for one year or longer (two official transcripts each if admitted). No minimum GPA or GRE score required."},
        "tui": "Stanford Chemistry PhD students receive full funding package. Application fee $125 for all applicants (U.S. citizens, permanent residents, international). Fee waivers available via Waiver Request Form submitted at least 10 business days before deadline. No MS degree program - applications only from candidates intending to pursue PhD. GRE scores valid approximately 5 years; TOEFL/IELTS scores valid 2 years. Stanford ETS institution code 4704.",
        "url": "details/stanford-chem-phd.html",
    },
    {
        "id": "harvard-chem-cb-phd",
        "s": "harvard",
        "n": "化学与化学生物学博士",
        "en": "PhD in Chemistry and Chemical Biology (Harvard University, Kenneth C. Griffin Graduate School of Arts and Sciences, Department of Chemistry and Chemical Biology; located in Cambridge, MA; part of Harvard Integrated Life Sciences; two degrees Chemistry and Chemical Physics; GSAS 2026-07-01 policy lists GRE Requirement Optional; SOP must be two sections with headers)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Average 5-6 years to complete; two distinct graduate degrees: Chemistry and Chemical Biology PhD, Chemical Physics PhD; must pass four advanced four-credit courses in chemistry and/or related fields (biochemistry, physics, etc.); minimum one year full-time study; on-campus residential (Cambridge, MA); admissions decisions in February; admitted student visit in late February or early March",
        "ddl": "Fall 2027 (September matriculation): **Deadline December 1, 2026 at 5:00 PM ET** per Harvard GSAS Chemistry and Chemical Biology program page (prior cycle Dec 1, 2025 5pm; deadline rolls forward annually). Department announces admissions decisions in February and invites accepted students to official visit during March; typically late February or early March. Fall admission only.",
        "lang": "TOEFL iBT minimum 80; IELTS minimum overall band 6.5. Required for applicants who did not graduate from a 4-year undergraduate institution where English is the first language. Scores must be from no earlier than January 5, 2024 (for 2026 entry). ETS institution code 3451 (The Graduate School of Arts and Sciences); no department code required. GRE scores valid no longer than five years; for fall 2027 admission, GRE scores from tests taken no earlier than January 5, 2022.",
        "test": {"cls": "GRE GENERAL OPTIONAL PER GSAS POLICY (Harvard GSAS programs list dated July 1, 2026: Chemistry and Chemical Biology GRE Requirement = Optional; Note: department legacy FAQ page states 'Yes, our program requires submission of the GRE General scores' - this legacy FAQ is outdated and superseded by GSAS 2026-27 policy. GRE Subject not required. Required materials: online application, Statement of Purpose in TWO SECTIONS clearly delineated within same document using headers 'statement of purpose' and 'research accomplishments': Statement of Purpose <=300 words, Research Accomplishments <=500 words, Personal Statement (Required), 3 LOR, transcripts. Academic background: record of classroom and laboratory training in biological, organic, inorganic, and physical chemistry."},
        "tui": "Harvard Chemistry and Chemical Biology PhD students receive multi-year fully-funded support through Harvard Griffin GSAS. Per department policy: Continuation in degree program contingent on (1) satisfactory completion of required coursework, (2) successful completion of PhD qualifying examination, (3) admission to a research group by end of second term in residence unless extension approved by director of graduate studies, (4) satisfactory progress in 300-level research courses. Non-native English speakers without undergraduate degree from English-speaking institution will be screened by Derek Bok Center for Teaching and Learning. Areas of study: Chemical Biology, Chemical Physics*, Inorganic, Organic, Physical, Theory. Part of Harvard Integrated Life Sciences facilitating collaboration and cross-disciplinary research.",
        "url": "details/harvard-chem-cb-phd.html",
    },
    {
        "id": "princeton-chem-phd",
        "s": "princeton",
        "n": "化学博士",
        "en": "PhD in Chemistry (Princeton University, Graduate School, Department of Chemistry; located in Princeton, NJ; housed in Frick Chemistry Laboratory; GRE general and subject strongly recommended but not required; PhD only - MS degree only open to industrial associates employees; optional diversity statement up to 500 words; PhD applicants must select subplan and up to 5 faculty)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "PhD typically 5 years; MS 2 years (MS only open to employees of firms with active membership in department industrial associates program); housed in world-class Frick Chemistry Laboratory; on-campus residential (Princeton, NJ); PhD awarded primarily on basis of thesis describing original research in one area of chemistry; students begin research during first year",
        "ddl": "Fall 2027 (September matriculation): **Deadline December 1, 2026 at 11:59 PM Eastern Standard Time** per Princeton Department of Chemistry. Application window opens September 2026. Admission decisions shared by February 1, 2027. Application fee $75. Note: some November GRE test results might not be officially submitted by ETS until after December 1 deadline; applicants may self-report to graduate program manager Meredith LaSalle-Tarantin by email as soon as available; November results usually received by Graduate School by mid-December allowing sufficient time for official report confirmation by admissions committee.",
        "lang": "TOEFL, IELTS, or Duolingo English Test scores per Princeton Graduate School English proficiency policy. ETS institution code 2672; no department code required. Computer-based TOEFL should be taken no later than December 1, or paper-based TOEFL no later than October 31, to ensure official scores released and received in time for review. Applicant exempt if undergraduate degree earned in entirety in country where native language is English.",
        "test": {"cls": "GRE GENERAL AND SUBJECT STRONGLY RECOMMENDED BUT NOT REQUIRED (Princeton Department of Chemistry: 'The submission of GRE subject and general test scores is strongly recommended but not required. There are no minimum test score requirements for admission. If submitted, the standardized scores are reviewed as part of the applicant's portfolio by the faculty review committee.' Required: transcripts, Resume/CV, academic and personal statements, letters of recommendation, online application, Chemistry (CHM) Course List, up to 5 faculty selections in application. Optional: diversity statement <=500 words describing how academic interests, background, or life experiences advance Princeton's commitment to diversity. Princeton Graduate School will not offer admission to applicant seeking second PhD in same or similar field of study."},
        "tui": "Princeton Chemistry PhD students receive five-year funding package including full tuition, student health plan coverage, and living stipend during regular enrollment. Housed in Frick Chemistry Laboratory - world-class facility at frontiers of science where lines between chemistry and other disciplines merge. Faculty and students conduct collaborative interdisciplinary research with potential ranging from new molecules and forms of energy to advanced models of catalysis and innovative materials. Graduate students invited and encouraged to pursue individualized programs. Admission decisions shared by February 1, 2027. MS degree only open to employees of firms with active membership in department industrial associates program.",
        "url": "details/princeton-chem-phd.html",
    },
    {
        "id": "berkeley-chem-phd",
        "s": "berkeley",
        "n": "化学博士",
        "en": "PhD in Chemistry (UC Berkeley, College of Chemistry, Department of Chemistry; located in Berkeley, CA; only admits students for PhD degree - no terminal MS; three concentrations Physical, Synthetic, Chemical Biology; GRE General REQUIRED (trend reversal); GRE Subject NOT required; minimum GPA 3.0; ~800 applications per year; Fall only)",
        "deg": "PhD",
        "lvl": "d",
        "stem": 1,
        "dur": "Typically 4-6 years to complete PhD; department only admits students for Doctor of Philosophy degree; no MS degree offered; formal course requirements are minimal and vary among disciplines; advisers tailor course requirements to best prepare student for chosen research field; single most important facet of curriculum is individual research project; Fall only; on-campus residential (Berkeley, CA)",
        "ddl": "Fall 2027 (August matriculation): **Application deadline December 1, 2026** per UC Berkeley Department of Chemistry and Berkeley Graduate Division. Application available from Graduate Division Admissions website beginning early September 2026. Deadline for supplemental information (transcripts, GRE and TOEFL scores, letters of recommendation, research summary) is also December 1, 2026. It is not required to contact faculty for application purposes, but if interested in particular faculty, please list them on application. Fall admission only.",
        "lang": "TOEFL or IELTS scores per Berkeley Graduate Division English proficiency requirements. ETS institution code 4833; no department code needed. GRE General Test score must be received by or before December 1, 2026. Applicants whose undergraduate degree was earned in entirety in English-speaking country may be exempt.",
        "test": {"cls": "GRE GENERAL REQUIRED (UC Berkeley College of Chemistry: 'GRE (General Test) is required. No required minimum score. Please send your test score directly from ETS to the institution code for UC Berkeley: 4833. No department code is needed. The GRE General Test score must be received by or before December 1, 2026. GRE Subject tests (e.g., Physics, Chemistry, Mathematics, etc.) are not required.' Required materials: online application, PDF transcripts from all college-level work, letters of recommendation, research summary, statement of purpose, GRE General scores (required), TOEFL or IELTS scores (if applicable). Minimum GPA 3.0. Undergraduate research is decisive factor in admission - reflects depth of interest in chemistry, potential for commitment to doctoral program, and potential scientific creativity. Application must be complete including LOR, transcripts, and test scores by deadline to be eligible for fellowships."},
        "tui": "UC Berkeley Chemistry PhD students receive multi-year fully-funded support through Graduate Division. Department usually receives about 800 applications each year; number of offers depends on admission allotments determined annually by Graduate Division. Three concentrations: (1) Physical Chemistry - experimental physical, analytical, nuclear, biophysical, and theoretical chemistry; (2) Synthetic Chemistry - preparation of organic or inorganic compounds, development of methods for synthesis, characterization and use; (3) Chemical Biology - research areas at interface of chemistry and biology, ranging from synthesis of bioactive materials to characterization of living systems. Fee waivers provided to members of various professional societies and program participants; also considered for demonstrated financial need. No MS degree - PhD only.",
        "url": "details/berkeley-chem-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> Round 258 - Chemistry PhD first tier sweep (MIT / Stanford / Harvard / Princeton / Berkeley). Key finding: Chemistry PhD GRE policy splits sharply across first tier. MIT NOT accepted (both General and Subject; all applications given full consideration without reference to GRE). Stanford all GREs optional (General and Subject; Chemistry dept TOEFL minimum 108 higher than University 90; deadline Nov 30, 2026 earlier than typical Dec 1). Harvard GSAS 2026-07-01 policy lists GRE Requirement Optional (department legacy FAQ page stating 'Yes, our program requires submission of the GRE General scores' is outdated and superseded); SOP must be two sections (Statement of Purpose <=300 words + Research Accomplishments <=500 words). Princeton GRE General and Subject strongly recommended but not required; MS degree only open to industrial associates employees; no second PhD in same or similar field. Berkeley GRE General REQUIRED (trend reversal; no minimum score; GRE Subject NOT required; minimum GPA 3.0; ~800 apps/year; 3 concentrations Physical/Synthetic/Chemical Biology). Berkeley continues to require GRE General in Chemistry even as most peer PhD programs have gone GRE-free or optional - this is a known trend reversal point to re-verify before next application cycle.
</div>
</body>
</html>
"""

PAGES = {
    "mit-chem-phd": {
        "school": "Massachusetts Institute of Technology, School of Science, Department of Chemistry",
        "en": "PhD in Chemistry",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Chemistry / CIP 40.0501)",
        "dur": "Typically 5-6 years; PhD and ScD awarded interchangeably by School of Science except in biology, cognitive science, neuroscience, medical engineering, medical physics; Fall only (September matriculation); on-campus (Cambridge, MA); students advised to have 2+ years research environment experience prior to applying",
        "ddl": "Fall 2027: **Deadline December 1, 2026 at 11:59 PM Eastern Time**. Application opens September 15, 2026. Application fee $90.00. All materials including LOR and official test scores due by deadline. Admissions decisions late January/early February. Test scores verified by provider no later than February 1, 2027. No Spring admission.",
        "lang": "TOEFL iBT minimum 100 (or 5 on iBT26 new scale); IELTS minimum overall band 7.0. Required for applicants whose primary language is not English. ETS institution code 3514; department code 62.",
        "test_cls": "GRE NOT ACCEPTED (General and Subject both not accepted; all applications given full consideration without reference to GRE scores). Required: Personal Statement 500-1000 words, Research Statement 1000-1500 words, 3 LOR, transcripts PDF upload (official only if admitted), English proficiency scores, CV. Admissions interview by invitation after initial faculty review.",
        "tui": "Full funding package. Per MIT Student Financial Services: specific costs for tuition, fees, books, supplies, housing, food, transportation. Department does not offer application fee waivers for Fall 2027. Areas: Chemical Biology, Inorganic Chemistry, Materials, Organic Chemistry, Physical Chemistry, Theory. NSF GRFP eligible.",
        "overview": "The MIT Department of Chemistry, within the School of Science, offers graduate work leading to the Doctor of Philosophy in Chemistry. The PhD program is designed to train students at the highest level in both theoretical and experimental chemistry. Per the Department Application Requirements page: Applications for Fall 2027 are open NOW, and the deadline is December 1, 2026. Due to the high volume of applications, the Department of Chemistry does not respond to requests for application updates via email or phone calls. We anticipate that admissions decisions will be finalized in late January/early February. During the active admissions cycle you must submit your application via the Online Application. Since offers of admission are made continuously after the application deadline, all of your materials must be submitted by the application deadline. This includes letters of recommendation and all official test scores. Per the Department FAQ: Do I have to take the GRE's? No, the MIT Department of Chemistry does not accept GRE scores for applications. All applications will be given full consideration without reference to GRE scores, this includes both the general test and Chemistry subject test scores. Do I need to have research experience prior to applying? We advise that students have 2 or more years of experience in a research environment (such as an undergraduate research position in a professor's research group) prior to applying. Do you offer Spring Term Admission? The MIT academic year begins in September, and PhD students are therefore only admitted for the fall semester. It is not possible to be admitted for the Spring term. Per the Office of Graduate Education degree program page: Chemistry at MIT Cambridge MA 02139. Application opens September 15; Deadline December 1 at 11:59 PM Eastern Time; Fee $90.00; NSF GRFP Field of Study: Chemistry; STEM Designation: STEM Eligible; Entry Term: Fall Term (September); Degrees: Doctor of Philosophy (PhD). Areas of Research: Chemical Biology, Inorganic Chemistry, Materials, Organic Chemistry, Physical Chemistry, Theory. Required materials: Online application, Personal statement 500-1000 words, Research statement 1000-1500 words, Three letters of recommendation, Transcripts (PDF copy required; official only if admitted; do not send paper transcript), English proficiency exam scores, Resume/CV (PDF or Word). Admissions Interview: Following initial review of all applications by faculty, some applicants will be invited via email to interview. Standardized Tests: For all applicants, Graduate Record Examination (GRE) is not required nor accepted for admission. For international applicants, IELTS or TOEFL. Minimum score required: 100 (iBT) or 5 (iBT26). Test Score Verification: All test scores due by application deadline, but test scores must be verified by test provider no later than February 1, 2027. CAMP Applications for Fall 2027 Admission are now CLOSED (deadline was November 1, 2026). The department is located in Cambridge, Massachusetts.",
        "requirements": "<ul><li>Bachelor's degree in chemistry or related quantitative field</li><li>GRE General: NOT accepted</li><li>GRE Chemistry Subject: NOT accepted</li><li>TOEFL iBT minimum 100 (or 5 on iBT26 new scale)</li><li>IELTS minimum overall band 7.0</li><li>Required for applicants whose primary language is not English</li><li>ETS institution code 3514; department code 62</li><li>MIT online application</li><li>Application fee $90.00</li><li>Personal Statement 500-1000 words</li><li>Research Statement 1000-1500 words</li><li>3 letters of recommendation</li><li>Transcripts PDF upload (official only if admitted)</li><li>Resume/CV (PDF or Word)</li><li>**Deadline December 1, 2026 at 11:59 PM ET**</li><li>Application opens September 15, 2026</li><li>Admissions interview by invitation after initial faculty review</li><li>Fall only (September matriculation; no Spring admission)</li><li>Test scores verified by provider no later than February 1, 2027</li><li>Students advised to have 2+ years research environment experience</li><li>Department does not offer fee waivers for Fall 2027</li><li>Full funding package</li><li>On-campus residential (Cambridge, MA)</li></ul>",
        "research": "<ul><li>Chemical Biology</li><li>Inorganic Chemistry</li><li>Materials Chemistry</li><li>Organic Chemistry</li><li>Physical Chemistry</li><li>Theoretical Chemistry</li><li>Biological Chemistry</li><li>Nanochemistry</li><li>Catalysis</li><li>Interdisciplinary research with MIT departments of biology, physics, chemical engineering, materials science, EECS</li></ul>",
        "source": '<a href="https://chemistry.mit.edu/academic-programs/graduate-programs/application-requirements/" target="_blank">MIT Chemistry Application Requirements (Fall 2027 deadline Dec 1, 2026; GRE test scores not accepted; TOEFL 100 / IELTS 7.0; CAMP deadline Nov 1, 2026; decisions late January/early February; no email/phone updates during cycle)</a> | <a href="https://chemistry.mit.edu/academic-programs/graduate-programs/faqs/" target="_blank">MIT Chemistry Admissions FAQ (No GRE scores accepted - general and subject; full consideration without reference to GRE; 2+ years research advised; Fall only no Spring; decisions late January/early February)</a> | <a href="https://oge.mit.edu/programs/chemistry/" target="_blank">MIT Office of Graduate Education: Chemistry PhD (opens Sept 15; deadline Dec 1 11:59pm ET; fee $90; NSF GRFP eligible; STEM designated; areas Chemical Biology/Inorganic/Materials/Organic/Physical/Theory; Personal statement 500-1000 words; Research statement 1000-1500 words; 3 LOR; interview by invitation; TOEFL 100/iBT26 5)</a> | <a href="https://oge.mit.edu/graduate-admissions/programs/doctoral-degrees/" target="_blank">MIT OGE Doctoral Degrees (PhD and ScD awarded interchangeably by School of Science except biology/cognitive science/neuroscience/medical engineering/medical physics; department may require minor outside principal field)</a>',
    },
    "stanford-chem-phd": {
        "school": "Stanford University, School of Humanities and Sciences, Department of Chemistry",
        "en": "PhD in Chemistry",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Chemistry / CIP 40.0501)",
        "dur": "Typically 5-6 years; applications accepted from candidates intending to pursue PhD only; no MS degree program; Autumn quarter (Fall) admission only; on-campus (Stanford, CA); research-focused with thesis",
        "ddl": "Fall 2027 (Autumn quarter matriculation): **Deadline Monday, November 30, 2026** (earlier than typical Dec 1). Application opens Tuesday, September 15, 2026. Application fee $125 for U.S. citizens, permanent residents, and international applicants. Fee waiver request must be submitted at least 10 business days (two weeks) before deadline.",
        "lang": "TOEFL iBT minimum 108 (before January 21, 2026) or 5.5 (on/after January 21, 2026 new scale); IELTS Academic minimum overall band 8. Chemistry Department minimum higher than University minimum (TOEFL 90 / IELTS 7). Required for international applicants not from English-official country or without 2+ years professional/educational English experience. ETS institution code 4704; no department code needed.",
        "test_cls": "ALL GRES OPTIONAL (General and Subject both optional; applicants may take general GRE in autumn prior to applying or earlier). Required: 3 LOR (letters speaking to lab experience, scientific creativity, potential to work independently), Statement of Purpose (describe research projects/skills/experience and specifically research interests at Stanford with research group names), TOEFL or IELTS Academic, one uploaded unofficial transcript from each university attended for one year or longer (two official transcripts each if admitted). No minimum GPA or GRE score.",
        "tui": "Full funding package. Application fee $125 for all applicants. Fee waivers via Waiver Request Form submitted at least 10 business days before deadline. No MS degree program - applications only from candidates intending to pursue PhD. GRE valid 5 years; TOEFL/IELTS valid 2 years. Stanford ETS institution code 4704.",
        "overview": "The Stanford University Department of Chemistry, within the School of Humanities and Sciences, offers the Doctor of Philosophy in Chemistry. Per the Department How to Apply page: IMPORTANT DATES: Application Submissions Open: Tuesday, September 15, 2026. Application Deadline: Monday, November 30, 2026. Applications are accepted from candidates who intend to pursue the Ph.D. degree. We do not have a MS degree program. Applications are submitted online with an application fee, paid by credit card. The web-based application allows applicants to save entries and return several times for edits before submitting the application. The application fee is $125 for U.S. citizens, permanent residents, and international applicants. Application Requirements: A complete application includes the online application and the following supplementary materials: three letters of recommendation (we value letters that speak to your lab experience and scientific creativity and potential to work independently to solve research problems), statement of purpose (describe your research projects/skills/experience and specifically your research interests at Stanford; provide details and research group names), TOEFL scores or IELTS Academic scores (minimum score of 108 for TOEFL or 8 for IELTS) for international applicants who are not from a country with English as an official language or do not have 2+ consecutive professional and educational experience using English, one uploaded unofficial transcript from each university you have attended for one year or longer (two official transcripts from each university you have attended for one year or longer, if you are admitted), official GRE scores (optional). Per the Department FAQ: Which exams are required? English Language Proficiency Tests: TOEFL or IELTS required for foreign applicants whose first language is not English, do not have a degree from a U.S. institution where all instruction is in English, or do not have 2+ consecutive years of professional or educational experience in English. Minimum TOEFL score for Chemistry Dept: 108 (taken before 1/21/26) / 5.5 (taken on or after 1/21/26). Minimum IELTS score for Chemistry Dept: 8. All GREs are optional. What is the minimum GPA or GRE requirement? There are no minimum GPA or GRE scores required for applying to the Chemistry Ph.D. program. The admissions committee evaluates each applicant's potential for success based on all materials in the file, recommendation letters, test scores, transcripts, and personal statements. It's best to get letters from referees who have observed your research promise. Select the type of waiver, fill out the Waiver Request Form, and submit it before the November 30, 2026 application deadline. Be sure to submit your fee waiver request at least 10 business days (two weeks) before the application deadline to ensure a timely decision. The department is located in Stanford, California.",
        "requirements": "<ul><li>Bachelor's degree in chemistry or related quantitative field</li><li>GRE General: optional</li><li>GRE Chemistry Subject: optional</li><li>No minimum GPA or GRE score</li><li>TOEFL iBT minimum 108 (before 1/21/26) or 5.5 (on/after 1/21/26)</li><li>IELTS Academic minimum overall band 8</li><li>Chemistry Department minimum higher than University (TOEFL 90 / IELTS 7)</li><li>Required for international applicants not from English-official country or without 2+ years English experience</li><li>ETS institution code 4704; no department code needed</li><li>Stanford online application</li><li>Application fee $125 (all applicants)</li><li>Fee waiver via Waiver Request Form (submit at least 10 business days before deadline)</li><li>3 letters of recommendation (letters speaking to lab experience, scientific creativity, independent research potential)</li><li>Statement of Purpose (describe research projects/skills/experience and specifically research interests at Stanford with research group names)</li><li>Unofficial transcript from each university attended for one year or longer (two official transcripts each if admitted)</li><li>**Deadline Monday, November 30, 2026** (earlier than typical Dec 1)</li><li>Application opens September 15, 2026</li><li>Autumn quarter (Fall) admission only</li><li>No MS degree program</li><li>GRE valid 5 years; TOEFL/IELTS valid 2 years</li><li>Full funding package</li><li>On-campus residential (Stanford, CA)</li></ul>",
        "research": "<ul><li>Organic Chemistry</li><li>Inorganic Chemistry</li><li>Physical Chemistry</li><li>Analytical Chemistry</li><li>Biological Chemistry</li><li>Materials Chemistry</li><li>Theoretical Chemistry</li><li>Catalysis</li><li>Synthesis and Methodology</li><li>Interdisciplinary research with Stanford departments of biology, physics, materials science, chemical engineering</li></ul>",
        "source": '<a href="https://chemistry.stanford.edu/academics/phd-program/admissions/how-apply" target="_blank">Stanford Chemistry How to Apply (opens Sept 15, 2026; deadline Nov 30, 2026; $125 fee; PhD only no MS; 3 LOR; SOP; TOEFL 108/IELTS 8; GRE optional; fee waiver 10 business days before deadline)</a> | <a href="https://chemistry.stanford.edu/academics/about-phd-program/admissions/frequently-asked-questions-phd" target="_blank">Stanford Chemistry PhD FAQ (TOEFL 108 before 1/21/26 / 5.5 on/after; IELTS 8; all GREs optional; no minimum GPA or GRE; letters from research promise observers; fee waiver form submit 10 business days before deadline)</a> | <a href="https://chemistry.stanford.edu/academics/phd-program/admissions/frequently-asked-questions" target="_blank">Stanford Chemistry FAQ (TOEFL Chemistry Dept minimum 108 higher than University 90; IELTS 8 higher than University 7; all GREs optional; GRE valid 5 years; TOEFL/IELTS valid 24 months; best letters from research promise observers)</a> | <a href="https://gradadmissions.stanford.edu/node/66" target="_blank">Stanford Graduate Admissions Test Scores (ETS institution code 4704; no department code needed; self-reported scores sufficient for initial review; official scores required if GRE required or optional; GRE scores valid 5 years; TOEFL/IELTS valid 2 years)</a>',
    },
    "harvard-chem-cb-phd": {
        "school": "Harvard University, Kenneth C. Griffin Graduate School of Arts and Sciences, Department of Chemistry and Chemical Biology",
        "en": "PhD in Chemistry and Chemical Biology",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Chemistry / CIP 40.0501; Chemical Biology / CIP 26.0507)",
        "dur": "Average 5-6 years; two distinct degrees: Chemistry and Chemical Biology PhD, Chemical Physics PhD; must pass four advanced four-credit courses in chemistry and/or related fields; minimum one year full-time study; on-campus (Cambridge, MA); admissions decisions February; admitted student visit late February or early March",
        "ddl": "Fall 2027 (September matriculation): **Deadline December 1, 2026 at 5:00 PM ET** per Harvard GSAS Chemistry and Chemical Biology program page (prior cycle Dec 1, 2025 5pm; rolls forward annually). Department announces admissions decisions in February and invites accepted students to official visit during March; typically late February or early March. Fall admission only.",
        "lang": "TOEFL iBT minimum 80; IELTS minimum overall band 6.5. Required for applicants who did not graduate from a 4-year undergraduate institution where English is the first language. Scores must be from no earlier than January 5, 2024. ETS institution code 3451 (The Graduate School of Arts and Sciences); no department code required. GRE valid 5 years; for fall 2027 admission, GRE scores from tests taken no earlier than January 5, 2022.",
        "test_cls": "GRE GENERAL OPTIONAL PER GSAS 2026-07-01 POLICY (Harvard GSAS programs list: Chemistry and Chemical Biology GRE Requirement = Optional; Note: department legacy FAQ page states 'Yes, our program requires submission of the GRE General scores' - this legacy FAQ is outdated and superseded by GSAS 2026-27 policy). Required: SOP in TWO SECTIONS clearly delineated within same document using headers 'statement of purpose' (<=300 words) and 'research accomplishments' (<=500 words), Personal Statement (Required), 3 LOR, transcripts. Academic background: record of classroom and laboratory training in biological, organic, inorganic, and physical chemistry.",
        "tui": "Multi-year fully-funded through Harvard Griffin GSAS. Continuation contingent on (1) satisfactory coursework, (2) successful PhD qualifying examination, (3) admission to research group by end of second term in residence (unless extension approved by DGS), (4) satisfactory progress in 300-level research courses. Non-native English speakers without undergraduate degree from English-speaking institution screened by Derek Bok Center. Areas: Chemical Biology, Chemical Physics*, Inorganic, Organic, Physical, Theory. Part of Harvard Integrated Life Sciences (HILS).",
        "overview": "The Harvard University Department of Chemistry and Chemical Biology, within the Kenneth C. Griffin Graduate School of Arts and Sciences, offers the Doctor of Philosophy in Chemistry and Chemical Biology. The program is part of the Harvard Integrated Life Sciences, which facilitates collaboration and cross-disciplinary research. Per the Department Prospective Students page: Our degree programs: We offer two distinct graduate degrees in Chemistry and Chemical Biology and Chemical Physics. Both programs take an average of 5 to 6 years to complete. Course Requirements: Chemistry and Chemical Biology Ph.D. candidates must pass four advanced courses in chemistry and/or related fields (e.g., biochemistry, physics, etc.). Chemical Physics Ph.D. candidates must pass four advanced courses in chemistry and/or related fields (e.g., biochemistry, physics, etc.). Required Tests: Anyone who did not graduate from a 4 year undergraduate institution where English is the first language, must submit either the TOEFL or IELTS. Submission of the general GRE test scores is required [legacy FAQ - superseded by GSAS 2026-27 policy]. Application: The Graduate School of Arts and Sciences facilitates the application submission process for both the Chemistry and Chemical Physics PhD programs. The application deadline is December 1st. The department announces admissions decisions in February and invites accepted students to an official visit during March. We typically host an admitted student visit in either late February or early March. Per the GSAS program page: Areas of Study: Chemical Biology, Chemical Physics*, Inorganic, Organic, Physical, Theory. Admissions Requirements: The Department of Chemistry and Chemical Biology offers a PhD in chemistry and a PhD in chemical physics. Applicants should have a record of classroom and laboratory training in biological, organic, inorganic, and physical chemistry as well as a strong grounding in chemistry and be thoughtful enough about the discipline of chemistry to communicate their desire to pursue doctoral research. Statement of Purpose: For applicants to chemistry and chemical biology, the statement of purpose should include two sections. Please clearly delineate the two sections within the same document using the headers 'statement of purpose' and 'research accomplishments.' Statement of Purpose: Statement of your scientific and professional interests and objectives, not to exceed 300 words. Research Accomplishments: Statement of your research accomplishments and/or current projects, not to exceed 500 words. In the event that undergraduate research opportunities have not been available to you, please discuss other science projects, reading projects, etc., that you have undertaken. Personal Statement: Required. Standardized Tests: GRE General: Required [legacy page; superseded by GSAS 2026-07-01 programs list which lists Optional]. Theses and Dissertations: [as per GSAS policy]. Degrees Offered: Doctor of Philosophy (PhD). Deadline: Dec 01, 2025 | 05:00 pm (prior cycle; rolls forward annually). Per the GSAS program expectations page dated July 1, 2026: PhD Course Requirements: Students must pass four advanced four-credit courses in chemistry and/or related fields. Language: Incoming PhD students who are non-native speakers of English and who have not received their undergraduate degree from an English-speaking institution will be screened by the Derek Bok Center for Teaching and Learning to determine their level of proficiency. Satisfactory Progress: Continuation in the degree program is contingent on: (1) satisfactory completion of required coursework, (2) successful completion of the PhD qualifying examination, (3) admission to a research group by the end of the second term in residence, unless extension of time has been approved by the director of graduate studies, and (4) satisfactory progress in 300-level research courses. Residence: A minimum of one year of full-time study is required. The department is located in Cambridge, Massachusetts.",
        "requirements": "<ul><li>Bachelor's degree in chemistry or related field with strong grounding in chemistry</li><li>Academic background: record of classroom and laboratory training in biological, organic, inorganic, and physical chemistry</li><li>GRE General: Optional per GSAS 2026-07-01 policy (legacy dept FAQ stating 'required' is superseded)</li><li>GRE Subject: not required</li><li>TOEFL iBT minimum 80</li><li>IELTS minimum overall band 6.5</li><li>Required for applicants who did not graduate from a 4-year undergraduate institution where English is the first language</li><li>Scores from no earlier than January 5, 2024</li><li>ETS institution code 3451; no department code required</li><li>Harvard Griffin GSAS online application</li><li>Statement of Purpose in TWO SECTIONS clearly delineated within same document using headers</li><li>Statement of Purpose: scientific and professional interests and objectives, <=300 words</li><li>Research Accomplishments: research accomplishments and/or current projects, <=500 words</li><li>Personal Statement (Required)</li><li>3 letters of recommendation</li><li>Transcripts</li><li>**Deadline December 1, 2026 at 5:00 PM ET**</li><li>Fall admission only</li><li>Admissions decisions in February</li><li>Admitted student visit in late February or early March</li><li>4 advanced four-credit courses in chemistry and/or related fields</li><li>PhD qualifying examination required</li><li>Admission to research group by end of second term in residence</li><li>300-level research courses</li><li>Minimum one year full-time study</li><li>Non-native English speakers screened by Derek Bok Center</li><li>Multi-year fully-funded through GSAS</li><li>On-campus residential (Cambridge, MA)</li></ul>",
        "research": "<ul><li>Chemical Biology</li><li>Chemical Physics</li><li>Inorganic Chemistry</li><li>Organic Chemistry</li><li>Physical Chemistry</li><li>Theoretical Chemistry</li><li>Biological Chemistry</li><li>Materials Chemistry</li><li>Interdisciplinary research through Harvard Integrated Life Sciences (HILS)</li><li>Cross-disciplinary research with Harvard departments of biology, physics, biophysics, engineering and applied sciences</li></ul>",
        "source": '<a href="https://gsas.harvard.edu/program/chemistry-and-chemical-biology" target="_blank">Harvard GSAS: Chemistry and Chemical Biology PhD (Areas: Chemical Biology/Chemical Physics/Inorganic/Organic/Physical/Theory; SOP two sections Statement of Purpose <=300 words + Research Accomplishments <=500 words; Personal Statement Required; TOEFL/IELTS for non-English-undergrad; ETS 3451; deadline Dec 1 prior cycle 5pm)</a> | <a href="https://www.chemistry.harvard.edu/prospective-students" target="_blank">Harvard CCB Prospective Students (two degrees Chemistry and Chemical Biology PhD + Chemical Physics PhD; average 5-6 years; 4 advanced courses; deadline Dec 1; decisions February; admitted student visit late February or early March; part of HILS)</a> | <a href="https://www.chemistry.harvard.edu/pages/admissions-faq" target="_blank">Harvard CCB Admissions FAQ (legacy page: GRE General required - superseded by GSAS 2026-07-01 policy; TOEFL 80 / IELTS 6.5 minimum; scores from no earlier than Jan 5, 2024; ETS 3451; apply to program not faculty directly)</a> | <a href="https://gsas.harvard.edu/apply/applying-degree-programs/gre" target="_blank">Harvard GSAS GRE Policy (three options Required/Optional/Not Accepted; ETS 3451; no department code; GRE valid 5 years; for fall 2027 admission GRE scores from tests no earlier than January 5, 2022; no minimum/average/required GRE scores stated by GSAS)</a> | <a href="https://gsas.harvard.edu/policy/chemistry-and-chemical-biology" target="_blank">Harvard GSAS Program Expectations dated July 1, 2026 (4 advanced four-credit courses; non-native English screened by Derek Bok Center; satisfactory progress = coursework + qualifying exam + research group by end of second term + 300-level research; minimum one year full-time study)</a>',
    },
    "princeton-chem-phd": {
        "school": "Princeton University, Graduate School, Department of Chemistry",
        "en": "PhD in Chemistry",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Chemistry / CIP 40.0501)",
        "dur": "PhD typically 5 years; MS 2 years (MS only open to employees of firms with active membership in department industrial associates program); housed in Frick Chemistry Laboratory; on-campus (Princeton, NJ); PhD awarded primarily on basis of thesis describing original research in one area of chemistry; students begin research during first year",
        "ddl": "Fall 2027 (September matriculation): **Deadline December 1, 2026 at 11:59 PM Eastern Standard Time**. Application window opens September 2026. Admission decisions shared by February 1, 2027. Application fee $75. Note: some November GRE test results might not be officially submitted by ETS until after December 1 deadline; applicants may self-report to graduate program manager Meredith LaSalle-Tarantin by email as soon as available.",
        "lang": "TOEFL, IELTS, or Duolingo English Test scores per Princeton Graduate School English proficiency policy. ETS institution code 2672; no department code required. Computer-based TOEFL should be taken no later than December 1, or paper-based TOEFL no later than October 31, to ensure official scores released and received in time. Applicant exempt if undergraduate degree earned in entirety in country where native language is English.",
        "test_cls": "GRE GENERAL AND SUBJECT STRONGLY RECOMMENDED BUT NOT REQUIRED (Princeton Department of Chemistry: 'The submission of GRE subject and general test scores is strongly recommended but not required. There are no minimum test score requirements for admission. If submitted, the standardized scores are reviewed as part of the applicant portfolio by the faculty review committee.' Required: transcripts, Resume/CV, academic and personal statements, letters of recommendation, online application, Chemistry (CHM) Course List, up to 5 faculty selections. Optional: diversity statement <=500 words. Princeton Graduate School will not offer admission to applicant seeking second PhD in same or similar field of study.)",
        "tui": "Five-year funding package including full tuition, student health plan coverage, and living stipend during regular enrollment. Housed in Frick Chemistry Laboratory - world-class facility at frontiers of science. Faculty and students conduct collaborative interdisciplinary research with potential ranging from new molecules and forms of energy to advanced models of catalysis and innovative materials. Admission decisions shared by February 1, 2027. MS degree only open to employees of firms with active membership in department industrial associates program.",
        "overview": "The Princeton University Department of Chemistry, within the Graduate School, offers graduate work leading to the Doctor of Philosophy in Chemistry. Per the Department Admissions page: The Princeton University Department of Chemistry is committed to providing an open and supportive learning environment for all students, faculty, and staff. As a community, we respect the dignity of each individual. Important Dates: September Application Window Opens; December 1 Application Deadline; By February Admission Decision. Admission Requirements: Step 1 - Please refer to Applying to Princeton for the authoritative requirements for admission to all graduate programs at Princeton University, including the Department of Chemistry. Step 2 - Specific requirements for application to the Department of Chemistry may be found on the Chemistry Field of Study page. Step 3 - Ultimately, all prospective graduate student must apply through the university Online Graduate School Application. Upon receiving applications from the Graduate School, the Department of Chemistry's Admissions Review Committee reviews each application in a holistic fashion, considering all aspects of the application file including prior research and coursework, letters of recommendation and standardized test scores. Further Details and Fine Print: Standardized Scores: The submission of GRE subject and general test scores is strongly recommended but not required. There are no minimum test score requirements for admission. If submitted, the standardized scores are reviewed as part of the applicant portfolio by the faculty review committee. Please note that some November GRE test results might not be officially submitted by ETS until after the December 1 deadline. You may self-report the test results to our graduate program manager, Meredith LaSalle-Tarantin, by email as soon as you have them. The November results are usually received by the Graduate School by mid-December allowing sufficient time for the official report to be confirmed by the admissions committee. Fee Waiver: [as per Graduate School policy]. Admissions Decisions and Campus Visit: Admissions decisions are shared by February 1st. Per the Graduate School degree requirements page: Department of Chemistry. Program Offerings: Ph.D. Graduate Program Administrator: [as listed]. The Department of Chemistry provides facilities for students intending to work toward the degree of Doctor of Philosophy (Ph.D.). The Department of Chemistry is a vital, expanding hub of scientific inquiry with deep historic roots and a ready grasp on the future. Housed in the world-class Frick Chemistry Laboratory, faculty and students work at the frontiers of science where the lines between chemistry and other disciplines merge. They conduct collaborative, interdisciplinary research with the potential to produce anything from new molecules and forms of energy to advanced models of catalysis and innovative materials. Graduate students are invited and encouraged to pursue individualized programs. Their experience is enhanced by strong faculty mentoring and access to world-leading intellectual and physical resources. The Ph.D. is awarded primarily on the basis of a thesis describing original research in one area of chemistry. Graduate students begin this research during their first year. Application deadline December 1, 11:59 p.m. Eastern Standard Time. Program length: Ph.D. 5 years, M.S. 2 years. Fee $75. GRE General Test optional/not required (recommended); Subject Test optional/not required (recommended). Additional departmental requirements: Ph.D. applicants are required to select a subplan when applying. Optional: Applicants may submit a statement with their application, briefly describing how their academic interests, background, or life experiences would advance Princeton's commitment to diversity within the Graduate School and to training individuals in an increasingly diverse society. Please submit a succinct statement of no more than 500 words. The M.S. degree is only open to employees of firms with active membership in the department's industrial associates program. Per the Graduate School Application for Admission policy: The Graduate School will not offer admission to an applicant seeking a second Ph.D. in the same or similar field of study. A bachelor's degree (or its foreign equivalent) is required to apply. Each department may have additional application requirements. Applicants whose native language is not English must demonstrate a level of oral proficiency by submitting scores from either TOEFL or IELTS. An applicant will only be exempt from this requirement if the undergraduate degree was earned in its entirety in a country where the native language is English. The department is located in Princeton, New Jersey.",
        "requirements": "<ul><li>Bachelor's degree in chemistry or related field (or foreign equivalent)</li><li>GRE General: strongly recommended but not required</li><li>GRE Chemistry Subject: strongly recommended but not required</li><li>No minimum test score requirements</li><li>TOEFL, IELTS, or Duolingo English Test</li><li>Required for applicants whose native language is not English</li><li>Exempt if undergraduate degree earned in entirety in country where native language is English</li><li>ETS institution code 2672; no department code required</li><li>Princeton Graduate School online application</li><li>Application fee $75</li><li>Transcripts</li><li>Resume or CV</li><li>Statement of academic purpose</li><li>Personal statement</li><li>3 letters of recommendation</li><li>Chemistry (CHM) Course List</li><li>Up to 5 faculty selections in application</li><li>PhD applicants must select a subplan when applying</li><li>Optional: diversity statement <=500 words</li><li>**Deadline December 1, 2026 at 11:59 PM EST**</li><li>Application window opens September 2026</li><li>Admission decisions shared by February 1, 2027</li><li>November GRE results may arrive late; self-report to graduate program manager</li><li>PhD typically 5 years; MS 2 years (MS only for industrial associates employees)</li><li>**No second PhD in same or similar field of study**</li><li>Five-year funding package (tuition + health plan + living stipend)</li><li>On-campus residential (Princeton, NJ)</li></ul>",
        "research": "<ul><li>Organic Chemistry</li><li>Inorganic Chemistry</li><li>Physical Chemistry</li><li>Analytical Chemistry</li><li>Biological Chemistry</li><li>Materials Chemistry</li><li>Theoretical Chemistry</li><li>Catalysis</li><li>Energy and sustainability</li><li>Interdisciplinary research with Princeton departments of physics, chemistry, molecular biology, engineering, applied and computational math</li></ul>",
        "source": '<a href="https://chemistry.princeton.edu/grad-program/admissions/" target="_blank">Princeton Chemistry Admissions (September opens; Dec 1 deadline; Feb 1 decision; GRE general and subject strongly recommended but not required; no minimum test scores; holistic review; self-report November GRE results to program manager Meredith LaSalle-Tarantin)</a> | <a href="https://gradschool.princeton.edu/academics/degrees-requirements/fields-study/chemistry" target="_blank">Princeton Graduate School: Chemistry PhD (PhD 5 years / MS 2 years; fee $75; GRE General optional/not required recommended; Subject optional/not required recommended; PhD applicants must select subplan; optional diversity statement <=500 words; MS only for industrial associates employees; housed in Frick Chemistry Laboratory; interdisciplinary research)</a> | <a href="https://gradschool.princeton.edu/admission-onboarding/prepare/required-tests" target="_blank">Princeton Graduate School Required Tests (GRE table per department; ETS institution code 2672 no department code; Required scores cannot be waived; Optional/Not Required - no disadvantage; Not Accepted - scores not reviewed)</a> | <a href="https://gradschool.princeton.edu/policies/application-admission" target="_blank">Princeton Graduate School Application for Admission (no admission to applicant seeking second PhD in same/similar field; bachelor degree required; CV, statement of academic purpose, transcripts, 3 LOR; TOEFL/IELTS for non-native English; exempt if undergrad degree in English-native country; computer-based TOEFL no later than Dec 1, paper-based no later than Oct 31)</a>',
    },
    "berkeley-chem-phd": {
        "school": "UC Berkeley, College of Chemistry, Department of Chemistry",
        "en": "PhD in Chemistry",
        "deg": "Doctor of Philosophy (PhD)",
        "stem_label": "STEM-designated (Chemistry / CIP 40.0501)",
        "dur": "Typically 4-6 years; department only admits students for Doctor of Philosophy degree; no MS degree offered; formal course requirements minimal and vary among disciplines; advisers tailor course requirements; single most important facet is individual research project; Fall only; on-campus (Berkeley, CA)",
        "ddl": "Fall 2027 (August matriculation): **Application deadline December 1, 2026**. Application available from Graduate Division Admissions website beginning early September 2026. Deadline for supplemental information (transcripts, GRE and TOEFL scores, letters of recommendation, research summary) is also December 1, 2026. It is not required to contact faculty for application purposes, but if interested in particular faculty, please list them on application. Fall admission only.",
        "lang": "TOEFL or IELTS scores per Berkeley Graduate Division English proficiency requirements. ETS institution code 4833; no department code needed. GRE General Test score must be received by or before December 1, 2026. Applicants whose undergraduate degree was earned in entirety in English-speaking country may be exempt.",
        "test_cls": "GRE GENERAL REQUIRED (UC Berkeley College of Chemistry: 'GRE (General Test) is required. No required minimum score. Please send your test score directly from ETS to the institution code for UC Berkeley: 4833. No department code is needed. The GRE General Test score must be received by or before December 1, 2026. GRE Subject tests (e.g., Physics, Chemistry, Mathematics, etc.) are not required.' Required: online application, PDF transcripts from all college-level work, letters of recommendation, research summary, statement of purpose, GRE General (required), TOEFL/IELTS (if applicable). Minimum GPA 3.0. Undergraduate research is decisive factor. Application must be complete including LOR, transcripts, test scores by deadline to be eligible for fellowships.)",
        "tui": "Multi-year fully-funded support through Graduate Division. Department usually receives about 800 applications each year; offers depend on admission allotments determined annually by Graduate Division. Three concentrations: (1) Physical Chemistry - experimental physical, analytical, nuclear, biophysical, theoretical chemistry; (2) Synthetic Chemistry - organic/inorganic compounds synthesis, methods, characterization, use; (3) Chemical Biology - interface of chemistry and biology, synthesis of bioactive materials, characterization of living systems. Fee waivers for members of professional societies and program participants; also considered for demonstrated financial need. No MS degree - PhD only.",
        "overview": "The UC Berkeley Department of Chemistry, within the College of Chemistry, offers the Doctor of Philosophy in Chemistry. Per the Department Admission Requirements page: Fall 2027 Application Information: We appreciate your interest in pursuing doctoral studies in Chemistry at UC Berkeley. Below, please find information regarding application deadlines and requirements. The 2027 application for graduate admission to the Department of Chemistry is electronic (paper applications cannot be accepted). The application is available from the Graduate Division Admissions website beginning in early September. The application deadline is December 1, 2026. The deadline for supplemental information (transcripts, GRE and TOEFL scores, letters of recommendation, research summary) is also December 1, 2026. It is not required to contact faculty for application purposes, however, if you are interested in particular faculty, please list them on your application. Application Fee Waivers: Application fee waivers are provided to members of various professional societies and program participants, including those that are members of [listed organizations]. Fee waivers are also considered for those with a demonstrated financial need. GRE (Graduate Record Exam): GRE (General Test) is required. No required minimum score. Please send your test score directly from ETS to the institution code for UC Berkeley: 4833. No department code is needed. The GRE General Test score must be received by or before December 1, 2026. GRE Subject tests (e.g., Physics, Chemistry, Mathematic, etc.,) are not required. Transcripts: Upload PDF files of all college level transcripts, with the application for initial departmental review. These must include your name and the name of the institution. Official transcripts of all college-level work will be required if you are admitted and intend to register for Fall 2027. Per the Department FAQ: Are there minimum scores required for the GRE? GRE (General Test) is required. No required minimum score. ETS 4833; no department code. The GRE General Test score must be received by or before December 1, 2026. GRE Subject tests are not required. Does the Department offer a Master of Science (MS) Degree? The department only admits students for the Doctor of Philosophy (Ph.D.) degree. Students normally complete the Ph.D. program in four to six years. How many applicants are offered admission each year? The numbers vary, but the department usually receives about 800 applications each year. My application is not completed by the application deadline, will I still be eligible for fellowships? Your application must be complete, including letters of recommendation, transcripts and test scores, by the application deadline to be eligible. How important is undergraduate research in evaluating an application? Undergraduate research is [a decisive factor] in admission. It reflects the applicant's depth of interest in chemistry, potential for commitment to a doctoral program, and potential scientific creativity. Can I be admitted to start in the Spring Semester? No, we admit our students to begin their studies in the fall semester only. What GPA is required for admission? The minimum grade point average required for admission is 3.0. Per the Berkeley Graduate Division program page: Chemistry PhD. Application Deadline December 1, 2026. Degrees Awarded: Doctoral / PhD. Admit Terms: Fall. Degree Types: Ph.D. GRE Requirements: Yes, general test. Contact: 419 Latimer Hall, Berkeley, CA 94720; email chem_grad_info@berkeley.edu; phone (510) 642-5884. Overview: The Chemistry PhD program is designed towards developing the ability to do creative scientific research. Accordingly, the single most important facet of the curriculum for an individual is his or her own research project. In keeping with the goal of fostering an atmosphere of scholarly, independent study, formal course requirements are minimal and vary among disciplines. Advisers tailor course requirements to best prepare the student for the chosen research field. The doctoral program includes the following concentrations, each of which has specific degree requirements: Physical Chemistry: In general, the Physical Chemistry Graduate Program encompasses experimental physical, analytical, nuclear, biophysical, and theoretical chemistry. Synthetic Chemistry: The Synthetic Chemistry Graduate Program includes emphases in preparation of organic or inorganic compounds, development of methods for their synthesis, and their characterization and use. Chemical Biology: The Chemical Biology Graduate Program covers research areas at the interface of chemistry and biology, ranging from the synthesis of bioactive materials to the characterization of living systems. The department is located in Berkeley, California.",
        "requirements": "<ul><li>Bachelor's degree in chemistry or related field</li><li>Minimum GPA 3.0</li><li>GRE General: REQUIRED (no minimum score)</li><li>GRE Subject: NOT required</li><li>ETS institution code 4833; no department code</li><li>GRE General Test score received by or before December 1, 2026</li><li>TOEFL or IELTS scores (if applicable)</li><li>Required per Berkeley Graduate Division English proficiency requirements</li><li>UC Berkeley Graduate Division online application</li><li>Application fee waivers for professional society members and program participants; also for demonstrated financial need</li><li>PDF transcripts from all college-level work (must include name and institution)</li><li>Letters of recommendation</li><li>Research summary</li><li>Statement of purpose</li><li>**Deadline December 1, 2026** for Fall 2027</li><li>Supplemental information (transcripts, GRE/TOEFL scores, LOR, research summary) also due December 1, 2026</li><li>Application available from Graduate Division Admissions website beginning early September 2026</li><li>Not required to contact faculty for application purposes, but list them on application if interested</li><li>Fall admission only (no Spring)</li><li>PhD only - no terminal MS degree</li><li>Typically 4-6 years to complete</li><li>Application must be complete by deadline to be eligible for fellowships</li><li>~800 applications per year</li><li>Undergraduate research is decisive factor in admission</li><li>Three concentrations: Physical / Synthetic / Chemical Biology</li><li>Multi-year fully-funded through Graduate Division</li><li>On-campus residential (Berkeley, CA)</li></ul>",
        "research": "<ul><li>Physical Chemistry (experimental physical, analytical, nuclear, biophysical, theoretical)</li><li>Synthetic Chemistry (organic/inorganic compounds synthesis, methods, characterization)</li><li>Chemical Biology (interface of chemistry and biology, synthesis of bioactive materials, characterization of living systems)</li><li>Organic Chemistry</li><li>Inorganic Chemistry</li><li>Biological Chemistry</li><li>Materials Chemistry</li><li>Analytical Chemistry</li><li>Theoretical Chemistry</li><li>Interdisciplinary research with Berkeley departments of biology, physics, chemical engineering, molecular and cell biology, public health</li></ul>",
        "source": '<a href="https://chemistry.berkeley.edu/grad/chem/apply" target="_blank">UC Berkeley Chemistry Admission Requirements (Fall 2027 deadline Dec 1, 2026; supplemental info also Dec 1; electronic application; GRE General required no minimum; GRE Subject not required; ETS 4833 no dept; fee waivers for professional society members and financial need; PDF transcripts upload; list faculty on application if interested)</a> | <a href="https://chemistry.berkeley.edu/faqs/chemistry-grad-faq" target="_blank">UC Berkeley Chemistry Grad FAQ (GRE General required no minimum; GRE Subject not required; ETS 4833; deadline Dec 1; PhD only no MS; 4-6 years; ~800 apps/year; application must be complete by deadline for fellowships; undergrad research decisive; Fall only; minimum GPA 3.0)</a> | <a href="https://grad.berkeley.edu/program/chemistry-phd/" target="_blank">Berkeley Graduate Division: Chemistry PhD (deadline Dec 1, 2026; Doctoral/PhD; Fall admit; GRE Yes general test; 419 Latimer Hall; chem_grad_info@berkeley.edu; (510) 642-5884; 3 concentrations Physical/Synthetic/Chemical Biology; formal course requirements minimal and vary among disciplines)</a> | <a href="https://chemistry.berkeley.edu/faq/chemistry-grad-faq/are-there-minimum-scores-required-gre" target="_blank">UC Berkeley Chemistry GRE FAQ (GRE General required; no minimum score; ETS 4833 no dept; score received by Dec 1, 2026; GRE Subject tests not required)</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)}")
