Anatomic location ontology navigation
Project description
anatomic-locations
Python library for anatomic location ontology navigation: hierarchy traversal, laterality variants, and semantic search.
Installation
pip install anatomic-locations
Features
- Hybrid Search: Combined full-text and semantic vector search
- Batch Search: One embedding API call for multiple queries via
search_batch() - Hierarchy Navigation: Traverse parent/child relationships with tree visualization
- Laterality Variants: Generate left, right, bilateral variants
- Auto-Download: Database downloads automatically on first use
- Flexible Lookup: Use location IDs (RID*), descriptions, or synonyms
Quick Start
The database auto-downloads on first use. No setup required.
from anatomic_locations import AnatomicLocationIndex
# Auto-open: no explicit open() or context manager needed for simple queries
index = AnatomicLocationIndex()
location = index.get("RID2772") # by RID
location = index.get("kidney") # by description (case-insensitive)
location = index.get("renal") # by synonym (case-insensitive)
print(location.description) # "kidney"
print(location.region.value) # "Abdomen"
Configuration
Override the default database path via environment variable or constructor:
# Environment variable
export ANATOMIC_DB_PATH=/path/to/custom.duckdb
# Or specify directly
index = AnatomicLocationIndex(db_path="/path/to/custom.duckdb")
Semantic Search
Set OPENAI_API_KEY (or ANATOMIC_OPENAI_API_KEY) to enable embedding-based semantic search. Without it, search uses keyword matching only (FTS), which may miss conceptual matches for multi-word queries.
CLI
The anatomic-locations CLI provides search, hierarchy navigation, and lookup commands. Use location IDs (e.g., RID2772) or names (e.g., "stomach"):
# Semantic search
anatomic-locations search "posterior cruciate ligament"
# Show full hierarchy tree
anatomic-locations hierarchy stomach
See the full CLI reference for all commands.
Related Packages
- findingmodel-ai: AI-assisted anatomic location discovery
- findingmodel: Core finding model library
Documentation
- Anatomic Locations Guide - Full CLI reference, Python API, and configuration
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anatomic_locations-0.2.3.tar.gz.
File metadata
- Download URL: anatomic_locations-0.2.3.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d715baf193723f29bfe334ed85205b18557bba8423631fa65331209b9145255
|
|
| MD5 |
abab3f502f3aae838628c4628caa248e
|
|
| BLAKE2b-256 |
9959f9bb962f234eb1cbaa71f4eb5a18cef810108aaebee772082dc9374644cd
|
File details
Details for the file anatomic_locations-0.2.3-py3-none-any.whl.
File metadata
- Download URL: anatomic_locations-0.2.3-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebb1b41983c07a36398164d09cc63e0a3b26ae54c1cd26ef509f12c33ef5cd15
|
|
| MD5 |
0a00ed102d27dd04ba08bf89d4d1300f
|
|
| BLAKE2b-256 |
60f24c22132926a497378feec86c5883c6966e7559cf0210df709cf826078165
|