Skip to content

Add convenience function for downloading a project attachment - #1067

Merged
bennybp merged 4 commits into
mainfrom
download_proj_attach
Oct 29, 2026
Merged

bennybp merged 4 commits into
mainfrom
download_proj_attach

Conversation

@bennybp

@bennybp bennybp commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Description

In QCPortal, adds a function to the Project model to download an attachment to mirror the Dataset model functionality. It was always possible before to go through the attachments property, but this can make it a little easier.

Also modified the dataset download_attachment function to not overwrite by default (to make it a little safer to use)

Status

  • Code base linted
  • Ready to go

Mirrors BaseDataset.download_attachment: looks up the attachment (refetching
if the cached list is stale), raises ValueError listing valid ids, and returns
the destination path. Defaults to not overwriting existing files.

Assisted-by: claude-code:claude-sonnet-5-5
Matches Project.download_attachment, ExternalFile.download and
PortalClient.download_external_file, and fails safe instead of silently
clobbering an existing file. Internal cache use already passes overwrite=True.

Assisted-by: claude-code:claude-sonnet-5-5
Assisted-by: claude-code:claude-sonnet-5-5
@bennybp
bennybp merged commit c43f699 into main Oct 29, 2026
20 checks passed
@bennybp
bennybp deleted the download_proj_attach branch October 29, 2026 21:57
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