nmrxiv-downloader: NMR Dataset Search & Download
CLI tool for searching and downloading NMR spectroscopy datasets from nmrxiv.org.
Setup
bash1# Install from PyPI 2pip install nmrxiv-downloader 3 4# Verify installation 5nmrxiv --help
Quick Reference
| Task | Command | JSON Path |
|---|---|---|
| List projects | nmrxiv list --type project | .items[].identifier |
| List datasets | nmrxiv list --type dataset | .items[].identifier |
| Search molecule | nmrxiv search --query "name" | .results[].canonical_smiles |
| Search SMILES | nmrxiv search --smiles "CCO" | .results[].iupac_name |
| Filter by experiment | nmrxiv search --type hsqc | .results[].identifier |
| Show details | nmrxiv show P5 | .item.download_url |
| Download | nmrxiv download P5 -o /tmp | .file, .size |
| Download + extract | nmrxiv download P5 -o /tmp --extract | .extracted_to |
Common Experiment Types
bash1nmrxiv search --type hsqc # 1H-13C HSQC 2nmrxiv search --type hmbc # HMBC 3nmrxiv search --type cosy # COSY 4nmrxiv search --type dept # DEPT 5nmrxiv search --type "1d-13c" # 1D 13C 6nmrxiv search --type noesy # NOESY 7nmrxiv search --type tocsy # TOCSY
Key Facts
- All output is JSON by default (add
--no-jsonfor human-readable) - Projects have download URLs, datasets don't - download via parent project
- Data hierarchy: Project → Study → Dataset → Files (Bruker, JCAMP-DX)
- Pagination: Use
--page Nfor large result sets
Workflow: Find and Download NMR Data
bash1# 1. Search for experiment type 2nmrxiv search --type hsqc 3 4# 2. Get dataset details (shows parent project) 5nmrxiv show D410 6 7# 3. Download parent project 8nmrxiv download P11 --output ./data --extract 9 10# 4. Data is now in ./data/P11/
Workflow: Search by Compound
bash1# 1. Search by name 2nmrxiv search --query "quercetin" 3 4# 2. Or by SMILES substructure 5nmrxiv search --smiles "c1ccc(O)cc1" 6 7# 3. Find related projects 8nmrxiv list --type project | jq '.items[] | select(.name | test("quercetin"; "i"))'
Error Handling
If download fails with "No download URL":
json1{"error": true, "message": "No download URL for D410. Try downloading parent project: P11", "code": 1}
→ Use the suggested parent project ID to download.
Parsing Examples
bash1# Get first project identifier 2nmrxiv list --type project | jq -r '.items[0].identifier' 3 4# Get all HSQC dataset IDs 5nmrxiv search --type hsqc | jq -r '.results[].identifier' 6 7# Get download URL for a project 8nmrxiv show P5 | jq -r '.item.download_url'