Skip to content

Add list-owned: enumerate every concept/DOI the account owns#13

Merged
jcschaff merged 1 commit into
mainfrom
add-list-owned
Jul 3, 2026
Merged

Add list-owned: enumerate every concept/DOI the account owns#13
jcschaff merged 1 commit into
mainfrom
add-list-owned

Conversation

@jcschaff

@jcschaff jcschaff commented Jul 3, 2026

Copy link
Copy Markdown
Member

What

A new read-only discovery command:

zenodo-maint list-owned                     # table: repo · concept DOI · latest · date · title
zenodo-maint list-owned --repo-only --json  # machine-readable; only GitHub-linked records

It answers the recurring question "which repos are actually tracked in Zenodo under this account?" — authoritatively, from Zenodo itself, rather than from a hand-maintained list (monitored.json, which drifts).

Why

Enumerating tracked concepts came up while scoping a release-backfill task. There was no first-class way to do it, and the deposit API has gotchas (pagination, concept-vs-version dedup) worth encoding once in the CLI instead of hand-rolling.

How

  • api.owned_records_all() — paginates /deposit/depositions (the existing owned_records() only took the first page).
  • api.repo_from_related() — extracts owner/repo from the isSupplementTo github.com related-identifier the archiver sets on every version.
  • cli.cmd_list_owned — dedupes depositions to the latest version per concept, maps each to its repo, and prints a table or --json; --repo-only filters to GitHub-linked records.

Tests

tests/test_repo_from_related.py covers tree/tag URLs, .git suffixes, deep paths (release URLs), picking the github link among other relations, and no-github/empty cases. Full suite: 20/20 green (stdlib unittest).

Example (this account)

12 concepts, all GitHub-linked — e.g. virtualcell/vcell (Virtual Cell 8.0), virtualcell/pyvcell, virtualcell/vcell-solvers, cam-center/SpringSaLaD, and the biosimulations/biosimulators family.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V5Ku5TpTMg7Ac3V3pMamyb

New read-only discovery command that answers 'which repos are tracked in Zenodo'
without a hand-rolled API call. Paginates /deposit/depositions, dedupes to the
latest version per concept, and maps each to its source GitHub repo (from the
isSupplementTo related-identifier). Table or --json; --repo-only filter.

- api.py: owned_records_all() (paginated) + repo_from_related() helper.
- cli.py: cmd_list_owned + subparser.
- tests: repo_from_related parsing (tree/tag, .git, deep paths, no-github).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5Ku5TpTMg7Ac3V3pMamyb
@jcschaff jcschaff merged commit 940f146 into main Jul 3, 2026
1 check passed
@jcschaff jcschaff deleted the add-list-owned branch July 3, 2026 09:21
jcschaff added a commit that referenced this pull request Jul 3, 2026
…imits

- Add the two previously-undocumented commands: list-owned (#13) and bootstrap.
- Reword check-drift to describe the membership semantics from this branch.
- Add an API gotcha: the public records API is 30 req/min and caps size at 25,
  so query one tag rather than enumerating all versions tokenlessly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZx7w9BexQc9wWU5JoHYaF
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