#!/usr/bin/env python3
"""Pace course units across a term calendar: lesson dates, holidays, review and assessment lessons.
Lessons fall on the given weekdays between --start and --end, minus holidays. Review lessons are inserted after
every N units and assessment lessons are kept at the end; the remaining lessons are shared between units in
proportion to their weights (default equal).
Usage:
python pacing.py --start 2026-09-07 --end 2026-12-18 --days mon wed fri --units 8 \
--holidays 2026-10-26:2026-10-30 2026-11-26 --review-every 3 --assessment 2
python pacing.py --start 2027-01-11 --end 2027-03-26 --days tue thu --weights 2 1 1 2
Exit codes: 0 printed, 1 fewer lessons than units (or under 2 per unit), 2 bad dates or arguments.
"""
import argparse
import datetime as dt
import sys
DAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
def holidays(specs):
out = set()
for s in specs:
a, _, b = s.partition(":")
d, end = dt.date.fromisoformat(a), dt.date.fromisoformat(b or a)
while d <= end:
out.add(d)
d += dt.timedelta(days=1)
return out
def main():
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("--start", type=dt.date.fromisoformat, required=True)
ap.add_argument("--end", type=dt.date.fromisoformat, required=True)
ap.add_argument("--days", nargs="+", choices=DAYS, required=True, help="lesson weekdays")
ap.add_argument("--units", type=int, help="number of units (equal weight)")
ap.add_argument("--weights", nargs="*", type=float, help="relative size of each unit instead of --units")
ap.add_argument("--holidays", nargs="*", default=[], help="YYYY-MM-DD or YYYY-MM-DD:YYYY-MM-DD")
ap.add_argument("--review-every", type=int, default=0, help="one review lesson after every N units")
ap.add_argument("--assessment", type=int, default=0, help="lessons kept for tests at the end")
try:
a = ap.parse_args()
off = holidays(a.holidays)
except ValueError as e:
print(f"error: {e}", file=sys.stderr)
return 2
weights = a.weights or [1.0] * (a.units or 0)
if not weights or a.end <= a.start:
print("error: need --units or --weights, and --end after --start", file=sys.stderr)
return 2
want = {DAYS.index(d) for d in a.days}
lessons, d = [], a.start
while d <= a.end:
if d.weekday() in want and d not in off:
lessons.append(d)
d += dt.timedelta(days=1)
n = len(weights)
reviews = (n - 1) // a.review_every if a.review_every else 0
teach = len(lessons) - reviews - a.assessment
lost = sum(1 for x in off if x.weekday() in want and a.start <= x <= a.end)
print(f"{len(lessons)} lessons ({lost} lost to holidays); {reviews} review, {a.assessment} assessment, "
f"{teach} for {n} units\n")
if teach < 2 * n:
print(f"error: only {teach} teaching lessons for {n} units; cut units or add lessons", file=sys.stderr)
return 1
share = [int(teach * w / sum(weights)) for w in weights]
for i in sorted(range(n), key=lambda i: teach * weights[i] / sum(weights) - share[i], reverse=True)[:teach - sum(share)]:
share[i] += 1
while min(share) == 0: # a tiny weight still gets one lesson
share[share.index(max(share))] -= 1
share[share.index(0)] += 1
print("| Block | Lessons | From | To |\n|-------|---------|------|----|")
k = 0
for u in range(n):
block = lessons[k:k + share[u]]
print(f"| Unit {u + 1} | {len(block)} | {block[0]} | {block[-1]} |")
k += share[u]
if a.review_every and (u + 1) % a.review_every == 0 and u + 1 < n:
print(f"| Review | 1 | {lessons[k]} | {lessons[k]} |")
k += 1
if a.assessment:
print(f"| Assessment | {a.assessment} | {lessons[k]} | {lessons[-1]} |")
return 0
if __name__ == "__main__":
sys.exit(main())
academic-english-eap-course-planner
Plan English for Academic Purposes (EAP) courses: pre-sessional, in-sessional, foundation, IELTS preparation and discipline-specific EAP, with syllabus strands (academic reading, lecture listening and note-taking, essay and report writing, paraphrase, summary and synthesis, referencing and plagiarism, seminars and presentations, academic vocabulary, critical thinking), a 10-week pre-sessional outline, exit assessment, IELTS-CEFR alignment and academic style (formality, hedging, cohesion, reporting verbs). Estimates study hours and weeks to close an IELTS gap from overall or per-skill scores (IELTS rounding, minimum per skill, priority skills, feasibility before a deadline), and checks learner texts for contractions, informal words with academic alternatives, unhedged claims, 'you', And/But/So starts, rhetorical questions and missing citations.
actfl-proficiency-curriculum-mapper
Map world language curricula to the ACTFL framework: proficiency levels (Novice, Intermediate, Advanced, Superior, Distinguished with sublevels), functions, contexts, text types and accuracy, proficiency vs performance, the three modes of communication (interpretive, interpersonal, presentational), the 5 Cs World-Readiness Standards, backward-designed thematic units with Integrated Performance Assessments, typical programme targets and FSI time estimates. Looks up approximate ACTFL-CEFR-ILR equivalences with what each level can do, and checks a unit map for missing modes, rehearsed skits mislabelled as interpersonal, translation or word lists as interpretive tasks, and units without an integrated performance assessment.
adult-literacy-esl-lesson-builder
Build lessons for adult ESL learners who are developing literacy (LESLLA learners: pre-literate, non-literate, semi-literate, literate in a non-Roman script): learner profiles and sensitive initial assessment, principles (oral language first, known to new, systematic phonics with adult-relevant text, repetition, classroom skills, respect for experience), a lesson routine (oral warm-up, review, new grapheme, blending, segmenting, decodable text, writing, functional literacy, Language Experience Approach), a phonics sequence for adults, sight words, functional literacy targets (forms, signs, medicine labels) and portfolio assessment. Checks whether a reading text is decodable with the letter-sound patterns and sight words taught so far, catching untaught digraphs, listing non-decodable words with the untaught part, and suggesting the most useful next patterns.
authentic-material-lesson-adapter
Turn authentic material (news articles, podcasts, videos, songs, menus, timetables, adverts, social media posts, forms, infographics) into language lessons by grading the task rather than the text. Selects texts for interest, relevance, exploitability, coverage, cultural load and rights; finds the 4-6 words to pre-teach, words to gloss on the page and words learners can ignore, plus names and cultural references to explain, with reading time by level; and builds a lesson shape (lead-in, pre-teach, gist or scanning, graded detail task, language focus on chunks and register, response) with task ideas per material type and level from A1 to C1. Covers copyright, fair dealing and fair use, Creative Commons and attribution.
can-do-statement-writer
Write and review can-do statements for language courses, units, lessons and learner self-assessment, CEFR or NCSSFL-ACTFL style: action (observable verb) + text or situation + level-specific conditions, learner ('I can') and descriptor ('Can') versions, progressions of one activity from A1 to C1, and coverage of reception, production, interaction and mediation. Includes a verb bank by mode and level and condition and text-type banks. Lints statements for teacher-centred phrasing, knowledge instead of use (learn, know, understand the passive), missing context, two skills in one statement, vague quality words, grammar items as outcomes, overlong statements and missing modes in a set.
cefr-aligned-syllabus-builder
Build language course syllabuses aligned to the CEFR (A1-C2, plus levels, Companion Volume 2020): entry and exit levels, guided learning hours and course length (with an L1-distance adjustment), syllabus type (topic, functional-notional, task-based, skills-based, multi-strand), unit-by-unit can-do outcomes, grammar from a core inventory by level, vocabulary, functions, pronunciation, balance of reception, production, interaction and mediation, recycling and assessment points. Checks a syllabus for units without can-do statements, core grammar for the level not covered, items above the course level, skills missing from most units and units with no vocabulary or functions.