refactor(snomed): re-export from biodb.snomed instead of in-tree impl - #6
Merged
Conversation
The SNOMED downloader (and the GitHub Release asset it pulls) moved into bioDB on 2026-05-18. This commit: * Replaces synthlab/download_snomed.py with a thin re-export shim. All existing imports ``from synthlab.download_snomed import ...`` keep working; the actual implementation lives in biodb.snomed. * Adds ``biodb`` as a dep in pyproject.toml. The release URL hard-coded in the old code (synthlab/vocab-v1) is replaced by biodb's. If callers were passing ``url=`` to override for a private mirror, the wrapper raises a DeprecationWarning and tells them to set GITHUB_TOKEN instead — bioDB's token-auth path against the same release tag is the supported escape hatch now. Net diff: -304 lines of duplicated download/auth/decompress logic, +76 lines of compat shim. Downstream behaviour unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SNOMED downloader + its GitHub Release asset moved into bioDB on 2026-05-18 (bioDB PR #15). This PR makes synthlab consume it from there.
Changes
synthlab/download_snomed.py: 379 lines of in-tree download / auth / decompress / gzip logic → 76-line back-compat shim that re-exports the public names frombiodb.snomed. Every existingfrom synthlab.download_snomed import ...keeps working.pyproject.toml: addbiodb @ git+https://github.com/bschilder/bioDBas a dep.Net effect
url=kwarg ondownload_snomed_vocabularyis preserved but now ignored (with aDeprecationWarningpointing callers atGITHUB_TOKENfor private mirrors against the bioDB release URL).Asset relocation note
The GitHub Release asset itself was physically moved: same
vocab-v1tag, sameCONCEPT.csv.gzfilename, identical SHA-256 (ce9029c84f1f5a5e300353f2833a4735f40bdf57e64262d46f4d4bfe274a04b7). New canonical URL:https://github.com/bschilder/bioDB/releases/download/vocab-v1/CONCEPT.csv.gz
The
bschilder/synthlabvocab-v1release will be deleted as a follow-up step (per the original move plan) once this PR merges and the new flow is confirmed working.Test plan
from synthlab.download_snomed import download_snomed_vocabulary, get_concept_csv_path, is_snomed_availableround-trips.download_snomed_vocabulary(url=...)with a non-default URL emitsDeprecationWarning.tests/test_snomed.pyprovides full coverage).🤖 Generated with Claude Code