Upload to Zenodo¶
Not part of run_together
run_together has no Zenodo stage; its publishing step uploads to S3 only. Run upload_zenodo yourself on a packaged directory (e.g., cartl/<id>/).
Overview¶
Use upload_zenodo to publish CartLoader outputs (PMTiles, factor files, and the catalog) to a Zenodo deposition, either an existing one or a newly created draft. In catalog mode, files are taken from catalog.yaml and uploaded in three groups: cartload basics (with catalog.yaml), additional basemaps (non-SGE PMTiles), and optional files (UMAP, alias), using the same grouping as upload_aws.
--restart deletes every file in the target draft
With --zenodo-deposition-id, --restart removes all files currently in the target draft deposition before uploading, including files that are not part of this upload and files a new-version draft inherited from the published record. To replace only the files you are uploading, use --overwrite instead.
--dry-run still changes Zenodo
--dry-run skips file uploads, file deletions, and publishing, but it still:
- creates a new deposition when
--zenodo-deposition-idis omitted; - opens a new-version draft when the ID points to a published record;
- writes the merged metadata to the deposition.
Requirements¶
- A packaged directory from
run_cartload2with acatalog.yaml(for--upload-method catalog). - A Zenodo access token saved in a file.
- For a new deposition:
--titleand at least one--creatorsentry. - (Optional) A Zenodo deposition ID to upload to an existing deposition.
Actions¶
- Choose the deposition. Without
--zenodo-deposition-id, a new draft is created with the given metadata. With an ID of a draft, that draft is used. With an ID of a published record, its latest unsubmitted draft is reused if one exists; otherwise a new version is created. New-version drafts start with the files of the published version. - Update metadata (existing depositions). Provided
--title,--description, and--creatorsreplace the existing values;--upload-type(defaultdataset) always replaces the existing type. - Select files by
--upload-method. Files are uploaded under their basenames. - Check capacity. If the deposition would hold more than 100 files (existing plus new distinct names), the command aborts before uploading.
- Upload. Files not yet in the deposition are uploaded; files whose names already exist are skipped unless
--overwrite(or--restart) is set. In catalog mode the groups are uploaded in order: basics withcatalog.yaml, then basemaps, then optional files. - Publish with
--publish(skipped in dry-run mode). Uploads rejected by Zenodo are listed at the end with a command to retry them; other upload errors (e.g., connection failures) are only printed in the log.
Example Usage¶
1 2 3 4 5 6 7 | |
--upload-method catalog: Upload the files referenced by the catalog.--titleand--creatorsare required for a new deposition.
1 2 3 4 5 6 7 | |
Add --overwrite to replace files that already exist in the deposition.
1 2 3 4 5 6 | |
--upload-method files: Upload only the files given by--files.
Parameters¶
Input Selection¶
--in-dir(str, required): Directory containing the files to upload.-
--upload-method(str): Which files to upload (default:all).--upload-methodOptionsall: every regular file directly in--in-dir(not recursive; includes Makefiles, logs, and flag files);catalog: the files referenced bycatalog.yaml, plus the catalog itself;files: only the files given by--files.
-
--files(list of str): Files to upload, relative to--in-diror absolute. Required with--upload-method files. --catalog-yaml(str): Catalog for--upload-method catalog(default:<in-dir>/catalog.yaml).
Zenodo Configuration¶
--zenodo-token(str, required): Path to a file containing your Zenodo access token.--zenodo-deposition-id(str): Existing deposition ID. A published record gets a draft (reused or newly created); omit to create a new deposition.--publish(flag): Publish the deposition after upload. Recommended to leave off and publish manually after reviewing the draft on Zenodo.
Zenodo Metadata¶
--title(str): Deposition title. Required for a new deposition.--creators(list of str): Creators, each quoted, e.g."Lastname, Firstname". Required for a new deposition.--description(str): Deposition description (new depositions default toNo description provided.).--upload-type(str): One ofdataset,software,publication,poster,presentation,image,video,lesson,other(default:dataset; also applied to existing depositions).
Behavior Flags¶
--overwrite(flag): Re-upload files whose names already exist in the deposition, replacing them.--restart(flag): Delete all files in the target draft first, then upload (see the warning above). Implies--overwrite.--dry-run(flag): Print the files that would be uploaded or deleted; Zenodo is still contacted and modified as described above.
Output¶
- Files uploaded to the Zenodo deposition (existing draft, new version draft, or new deposition); the deposition ID is printed.
- With
--upload-method catalog(not in dry-run mode):<in-dir>/cartload.zenodo.doneis touched after the basics group, even if some of its files failed to upload, and<file>.zenodo.doneis written next to each successfully uploaded basemap or optional file. Check the log for failures before relying on these flags.