Registry / data / umls-downloader

umls-downloader

JSON →
library0.1.3pypypi✓ verified 88d ago

Automates downloading UMLS (Unified Medical Language System) data from the NLM, including MRCONSO.RRF, RxNorm, and SNOMED-CT. Current version 0.1.3, released Jan 2024. Monthly or ad-hoc releases.

pip install umls-downloader
INSTALL
IMPORT
SIG · UMLS-DOWNLOADER
U
umls-downloader
datapythonv0.1.3
Install
2.9s avg
Import
1109ms
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.178s · 26.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.9s · import 1.040s · 27MB
24MB installed
● package 24MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

download_umls
✓ from umls_downloader import download_umls
✗ import umls_downloader ... umls_downloader.download_umls()
common but verbose; recommended import is from umls_downloader import download_umls
download_rxnorm
✓ from umls_downloader import download_rxnorm
✗ from umls_downloader.rxnorm import download_rxnorm
wrong: no submodule rxnorm; all functions are top-level
download_snomed
✓ from umls_downloader import download_snomed
✗ from umls_downloader import download_snomedct
wrong: function is download_snomed, not download_snomedct

Download UMLS Metathesaurus MRCONSO.RRF for a given release version. API key required.

from umls_downloader import download_umls # Requires UMLS API key from https://uts.nlm.nih.gov/uts/ # Set environment variable UMLS_API_KEY or pass directly path = download_umls(apikey='YOUR_API_KEY', version='2023AA') print(f'Downloaded MRCONSO.RRF to {path}')
Debug
Known issues
gotchaUMLS API key is required. Set environment variable UMLS_API_KEY or pass apikey argument. Without key, download fails with authentication error.
fix
Obtain API key from https://uts.nlm.nih.gov/uts/ and set as UMLS_API_KEY environment variable or pass as argument.
affects: all
breakingVersion 0.1.2 changed the MRCONSO.RRF download structure due to upstream UMLS changes. Older releases may fail with v2023AA+.
fix
Upgrade to >=0.1.2 for compatibility with current UMLS releases.
affects: <0.1.2
gotchadownload_umls returns the path to the downloaded RRF file (not a ZIP). The file is extracted from the UMLS ZIP automatically.
fix
Use returned path directly; no need to unzip manually.
affects: all
deprecatedVersion 0.0.2 introduced force_download parameter. In >=0.1.0, behavior changed: files are not re-downloaded by default. Use force=True to override.
fix
Pass force=True to download again if file exists.
affects: >=0.1.0
Errors
Common errors & fixes
UTSProfileError: Authentication error. Please check your UMLS API key.
Invalid or missing UMLS API key.
fix
Set UMLS_API_KEY environment variable or pass valid apikey to download function.
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://download.nlm.nih.gov/umls/...
The requested UMLS version (e.g., '2020AA') is no longer available or the URL changed.
fix
Use a supported version (e.g., '2023AA' or latest). Check https://www.nlm.nih.gov/research/umls/licensedcontent/umlsknowledgesources.html
AttributeError: module 'umls_downloader' has no attribute 'download_snomedct'
The function is named download_snomed, not download_snomedct.
fix
Use download_snomed instead.
FileNotFoundError: [Errno 2] No such file or directory: 'MRCONSO.RRF' after download
The file is extracted inside a subdirectory (e.g., '2023AA/META/MRCONSO.RRF') but the function returns the wrong path in some versions.
fix
Update to latest version (0.1.3) and ensure you use the returned path directly.
Upgrade
Version history
0.1.3latest on PyPI · released Apr 2, 2024
Audit
Dependencies
requestsrequiredHTTP requests for UMLS TGT authentication and downloads
Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
umls-downloader — pip install umls-downloader · libregistry