Repository navigation
1.7.0: zip a unit's Ed Lessons materials and store them by unit code - #29
Merged
Merged
Conversation
- `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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_filesshowed only Moodle files, and themonash librarypage 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>, aLinks.mdper lesson (reading pages and the Ed page), and aREADME.mdwith progress and any files that failed to download. Built from local files only.monash librarypage and theexport_ed_lessonsMCP tool.ed-files/<unit code>/<NN module>/<NN lesson>/<NN title>, in Ed's order.monash open edopens the folder.<file>onedusercontent.com) are downloaded and indexed, up to 200 MB each. Other sites are not followed.list_filesincludes Ed files withed:paths thatread_fileaccepts, filtered by unit, week or name.How:
lessons.pybuilds readable folder names from the unit code (FIT3162/FIT3164→FIT3162+FIT3164), module order and lesson index, and moves files from the previouslocal_pathinstead of re-downloading. Attachments get a stable negative id derived from their URL so they sharelesson_fileswith slides without clashing.New
edexport.pyrecomputes the zip layout fromed.db, so files still in the old numeric layout export with the same structure. CLI, library and MCP all call it.export_ed_lessonsis marked not read-only because it writes a zip on the user's computer, so remote mode does not list it; it is hidden withuse_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 helpupdated.Tests added or updated, and
uv run pytest -qpasses (411 passed, 9 skipped; newtests/test_ed_export.pywith a synthetic Ed API)uvx ruff@0.6.9 check src tests scriptspassesIf
src/changed:__version__bumped andCHANGELOG.mdupdatedStill 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-accountmonash sync+monash ed export.