Skip to content

Add dataherb catalog add; read Markdown catalog entries - #27

Merged
emptymalei merged 3 commits into
masterfrom
claude/add-dataset-repos-ghxvls
Oct 7, 2026
Merged

emptymalei merged 3 commits into
masterfrom
claude/add-dataset-repos-ghxvls

Conversation

@emptymalei

@emptymalei emptymalei commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Requested by L · project thread

Before: listing a git repo in an explorer catalog meant hand-writing catalog/<id>.yml, and entries had no room for free text.

After:

  • Markdown entries. catalog/<id>.md holds the entry fields in YAML front matter. Its body becomes the dataset's documentation, shown above the dataset's own documentation. .md files without front matter, such as a README, are ignored. .yml and .json entries still work.
  • dataherb catalog add owner/repo ... or dataherb catalog add --org DataHerb --match dataset writes the entries, as .md by default (--format yml for the old style).
    • A repo with metadata (dataherb.json, dataherb.yml, .dataherb/metadata.yml) gets a pointer entry.
    • A repo without metadata gets an inline entry, with files, columns and row counts inferred the way dataherb create does it.
    • Repos already in the catalog are skipped. --force overwrites the front matter and keeps the body. Ids drop the --match prefix, and --dry-run previews.

How:

  • util.split_front_matter / front_matter_document.
  • resolve.load_entries reads .md files and keeps the body as _body. normalize puts it in front of the dataset's own documentation.
  • New catalog/add.py. It probes metadata through the config's git store (raw URLs, token_env). When that fails, because a repo has no metadata or is private and there's no token, it shallow-clones the repo with the local git credentials. --org pages through /orgs/{org}/repos, falling back to /users/, and --api-url points it at GitHub Enterprise.
  • Tests are in tests/catalog/test_add.py and test_catalog.py. The full suite passes (26 tests).

DataHerb/dataherb-explorer#1 uses this and is pinned to this branch until it merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ggg4AutCcRdK8c57NMxSqp

Writes one catalog/<id>.yml per repo: a pointer when the repo has
dataherb metadata, otherwise an inline entry inferred from a shallow
clone. --org/--match pick every repo of a GitHub org by name prefix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ggg4AutCcRdK8c57NMxSqp
catalog/<id>.md holds the entry fields in YAML front matter and free
text in the body, which becomes the dataset's documentation (before the
dataset's own). .md files without front matter, like a README, are
ignored. `dataherb catalog add` writes .md by default (--format yml for
the old style) and keeps the body when overwriting with --force.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ggg4AutCcRdK8c57NMxSqp
@emptymalei emptymalei changed the title Add dataherb catalog add for git repos Add dataherb catalog add; read Markdown catalog entries Oct 7, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ggg4AutCcRdK8c57NMxSqp
@emptymalei
emptymalei merged commit d1d46b0 into master Oct 7, 2026
2 checks passed
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.

2 participants