Download a student's artwork images
artsonia_download_artworkDownload full-resolution student artwork images to a local folder, optionally filtering by class, grade, or recent count, and saving comments or EXIF metadata.
Instructions
Download full-resolution images of a student's artwork to a local folder, named from the artwork title/project/grade and time-stamped to the image's source date. Optionally filter by class/project (substring), grade, and/or keep only the most-recent N (the portfolio is reliably newest-first). Re-runs are idempotent (skip_existing). Runs immediately, with no confirmation step; writes only inside the allowed download folders. write_metadata:true also saves each artwork's comments + teacher feedback as a .json sidecar next to its image. embed_metadata:true embeds title/project/grade/date into each JPEG's EXIF/IPTC. path_template (e.g. "{grade}/{project}" or "{school_year}") organizes downloads into subfolders for multi-year archives. Note: descriptive filenames need each artwork's detail page (slower) — use filename_template "{artwork_id}" for the fast id-only path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dest | Yes | Local destination folder (a leading ~ is expanded). Created if missing. Must be inside the allowed download folders: ARTSONIA_OUTPUT_DIR when set, otherwise ~/Downloads or ~/Pictures (on a hosted server, $MCP_DATA_DIR/downloads); anything else is refused before any download. | |
| grade | No | Only artworks created in this grade, e.g. "6" or "Grade 6". | |
| limit | No | Keep only the N most recent matching artworks (portfolio is newest-first). | |
| project | No | Only artworks whose school-project/class name contains this (case-insensitive). | |
| artist_id | Yes | Student artist_id (from artsonia_list_students). | |
| resolution | No | Image resolution. "full" is the original (~0.7 MB each). | full |
| write_index | No | After downloading, write an index.json manifest into the destination folder listing the downloaded items (artwork_id, title, file, grade, project, date). Off by default. | |
| path_template | No | Optional subfolder pattern under dest, composed with filename_template — e.g. "{grade}/{project}" or "{school_year}" for multi-year archives. Same tokens as filename_template; segments are slugified like filenames and empty tokens collapse (no empty folders). Paths are deterministic, so skip_existing re-runs stay idempotent. {school_year} (July–June, e.g. "2021-2022") derives from the image's Last-Modified. | |
| skip_existing | No | Skip artworks whose target file already exists (idempotent re-runs). Set false to overwrite. | |
| embed_metadata | No | Embed each image's title/project/grade and source date (its Last-Modified, same as date_source) into the JPEG's EXIF (ImageDescription, DateTimeOriginal) and IPTC (title, keywords, date) so the metadata survives renames/moves and is searchable in Spotlight/Apple Photos. Needs each artwork's detail page (slower); applies to freshly downloaded files only (skipped files are left untouched). Off by default. | |
| write_metadata | No | After downloading, write a per-artwork <image-name>.json sidecar next to each image with the artwork's comments and teacher feedback (plus title/project/grade). Fetches each artwork's detail page + the student's feedback page. Off by default. | |
| include_private | No | Include artworks marked private in the portfolio. Set false to exclude them (excluded count is reported as private_excluded_count). | |
| filename_template | No | Filename pattern. Tokens: {title} {project} {grade} {date} {school_year} {artwork_id}. The artwork_id is auto-appended for uniqueness if absent. Use "{artwork_id}" for the fast id-only path (no detail fetch). | {grade} - {project} - {title} |
| set_mtime_from_source | No | Set each file's modified time from the image's Last-Modified header (its Artsonia upload date) instead of the download moment. |