Skip to content

1.7.0: zip a unit's Ed Lessons materials and store them by unit code - #29

Merged
Waldo0926 merged 4 commits into
mainfrom
feat/ed-lessons-export
Nov 1, 2026
Merged

Waldo0926 merged 4 commits into
mainfrom
feat/ed-lessons-export

Conversation

@Waldo0926

@Waldo0926 Waldo0926 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Before:

Study Kit synced Ed Lessons PDFs into ed-files/<course id>/<lesson id>/ but had no way to take a whole unit's materials away in one go; that needed Ed Web. Files attached inside Ed pages were not downloaded, list_files showed only Moodle files, and the monash library page skipped Ed files because sync stores relative paths.

After:

  • monash ed export FIT2109 [--module "Week 3"] [--to DIR] [--open] zips a unit's synced Ed Lessons into Downloads: FIT2109 Ed Lessons/<NN module>/<NN lesson>/<NN title>, a Links.md per lesson (reading pages and the Ed page), and a README.md with progress and any files that failed to download. Built from local files only.
  • The same export is a per-unit button on the monash library page and the export_ed_lessons MCP tool.
  • Ed files are stored as ed-files/<unit code>/<NN module>/<NN lesson>/<NN title>, in Ed's order. monash open ed opens the folder.
  • Files Ed hosts inside document and code slides (<file> on edusercontent.com) are downloaded and indexed, up to 200 MB each. Other sites are not followed.
  • A replaced PDF (new file URL) is downloaded again; files of removed slides and empty folders are deleted.
  • list_files includes Ed files with ed: paths that read_file accepts, filtered by unit, week or name.
  • The library page lists Ed files synced by this package.

How:

  • lessons.py builds readable folder names from the unit code (FIT3162/FIT3164 → FIT3162+FIT3164), module order and lesson index, and moves files from the previous local_path instead of re-downloading. Attachments get a stable negative id derived from their URL so they share lesson_files with slides without clashing.

  • New edexport.py recomputes the zip layout from ed.db, so files still in the old numeric layout export with the same structure. CLI, library and MCP all call it.

  • export_ed_lessons is marked not read-only because it writes a zip on the user's computer, so remote mode does not list it; it is hidden with use_ed false. The tool-count budget goes from 19 to 20; the size budget (9200) is unchanged and the original 17 tool contracts are byte-for-byte the same.

  • Version 1.7.0 (main already carries an unreleased 1.6.0), with CHANGELOG, both READMEs, SKILL.md and monash help updated.

  • Tests added or updated, and uv run pytest -q passes (411 passed, 9 skipped; new tests/test_ed_export.py with a synthetic Ed API)

  • uvx ruff@0.6.9 check src tests scripts passes

  • If src/ changed: __version__ bumped and CHANGELOG.md updated

  • Still read-only towards Moodle and Ed (the only write is the local zip), and no real names, ids, cookies or tokens in the new test samples

Also checked: uv build + scripts/check_dist.py dist 1.6.0 (before the bump); the library page on synthetic data at desktop and phone widths (zip downloads, unknown course returns 404). Not yet done: one real-account monash sync + monash ed export.

- `monash ed export FIT2109 [--module] [--to] [--open]` packs the synced
  Ed Lessons of a unit into a zip in Downloads: one folder per module,
  files in Ed's order, Links.md per lesson, README.md with progress and
  files that failed to download. Reads only local files.
- Same export as a per-unit button on the `monash library` page and as
  the `export_ed_lessons` MCP tool (not read-only, so remote mode hides
  it; hidden with use_ed false).
- Ed files are stored as <unit code>/<NN module>/<NN lesson>/<NN title>
  instead of numeric ids. The first sync moves files from the old layout
  rather than downloading them again. `monash open ed` opens the folder.
- Files Ed hosts inside document/code pages are downloaded and indexed
  (edusercontent.com only, 200 MB cap). A replaced PDF is downloaded
  again; files of removed slides are deleted with their empty folders.
- list_files includes Ed Lessons files with ed: paths.
- Fix: the library page skipped Ed files stored with relative paths.
@Waldo0926 Waldo0926 changed the title 1.6.0: zip a unit's Ed Lessons materials and store them by unit code 1.7.0: zip a unit's Ed Lessons materials and store them by unit code Nov 1, 2026
@Waldo0926
Waldo0926 merged commit 9c5fa83 into main Nov 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant