Skip to content

Add CSV to BabelTests tool#77

Draft
gaurav wants to merge 2 commits into
add-github-issue-testsfrom
add-curies-to-babeltests-tool
Draft

Add CSV to BabelTests tool#77
gaurav wants to merge 2 commits into
add-github-issue-testsfrom
add-curies-to-babeltests-tool

Conversation

@gaurav
Copy link
Copy Markdown
Collaborator

@gaurav gaurav commented May 4, 2026

Translator collaborators sometimes circulate spreadsheets pairing a CURIE column with a label, equivalent CURIE, or Biolink type. This adds a click CLI that ingests such CSVs and emits a paste-ready YAML babel_tests block for a GitHub issue, optionally validating each row against a NodeNorm target from tests/targets.ini and reporting failures on stderr.

The tool reuses ASSERTION_HANDLERS and CachedNodeNorm directly so the emitted YAML is guaranteed to match what GitHubIssuesTestCases parses, and per-assertion semantics never drift between the two code paths.

Wires hatchling as the build backend (packaging src/ as-is so existing from src.babel_validation.X imports keep working) so the csv-to-babeltests console script can be exposed via [project.scripts].

WIP. Should be merged after PR #67

…AML.

Translator collaborators sometimes circulate spreadsheets pairing a CURIE
column with a label, equivalent CURIE, or Biolink type. This adds a click
CLI that ingests such CSVs and emits a paste-ready YAML babel_tests block
for a GitHub issue, optionally validating each row against a NodeNorm
target from tests/targets.ini and reporting failures on stderr.

The tool reuses ASSERTION_HANDLERS and CachedNodeNorm directly so the
emitted YAML is guaranteed to match what GitHubIssuesTestCases parses,
and per-assertion semantics never drift between the two code paths.

Wires hatchling as the build backend (packaging src/ as-is so existing
`from src.babel_validation.X` imports keep working) so the
csv-to-babeltests console script can be exposed via [project.scripts].

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…v-to-babeltests.

- --from-google-sheet URL: download any Google Sheet CSV-export URL and run
  the same downstream pipeline as a local file
- --from-yaml FILE (reverse mode): parse an existing babel_tests: YAML block
  and validate it against --target, printing a report to stderr
- INPUT_CSV, --from-google-sheet, and --from-yaml are mutually exclusive
- Add tests/data/csv_to_babeltests_fixture.csv as a committed data asset with
  tricky label cases (commas, apostrophes, brackets), an empty CURIE row, and
  a duplicate; extend it to cover new edge cases as they arise
- 11 new unit tests covering the fixture CSV pipeline and parse_yaml_blocks;
  all 24 tests pass
- Unblock tests/data/ from .gitignore so fixture files can be committed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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