Skip to main content

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
  • Hierarchy Navigation: Traverse parent/child relationships
  • Laterality Variants: Generate left, right, bilateral variants
  • Auto-Download: Database downloads automatically on first use

Configuration

The anatomic location database is automatically downloaded on first use. To use a custom path:

# Optional: Custom database path
ANATOMIC_DB_PATH=/mnt/data/anatomic_locations.duckdb

CLI (anatomic-locations)

# Search for anatomic locations
anatomic-locations search "posterior cruciate ligament"

# Show hierarchy for a location
anatomic-locations hierarchy RID2905

# List children of a location
anatomic-locations children RID56

Python API

import asyncio
from anatomic_locations import AnatomicLocationIndex

async def main():
    async with AnatomicLocationIndex() as index:
        # Hybrid search (FTS + semantic)
        results = await index.search("knee joint", limit=10)
        for result in results:
            print(f"- {result.name} ({result.id})")

        # Get location by ID
        location = await index.get("RID2905")
        if location:
            print(f"Name: {location.name}")
            print(f"Parents: {location.parents}")

        # Get children
        children = await index.get_children("RID56")
        for child in children:
            print(f"  - {child.name}")

        # Generate laterality variants
        variants = await index.get_laterality_variants("RID2905")
        for variant in variants:
            print(f"  {variant.laterality}: {variant.name}")

asyncio.run(main())

Related Packages

Documentation

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

anatomic_locations-0.2.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anatomic_locations-0.2.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file anatomic_locations-0.2.0.tar.gz.

File metadata

  • Download URL: anatomic_locations-0.2.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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

Hashes for anatomic_locations-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7919e11e2525cc977d73ec8db4ad08166e5d0ff4ec68665fc16eccbfb6306cdf
MD5 62c183aa4ff20eaf49018a2bc6f7cdb3
BLAKE2b-256 e091a63a2268b119e0efc519145c8d89c019d0fa3af2adf7ac6b37d001863d4f

See more details on using hashes here.

File details

Details for the file anatomic_locations-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: anatomic_locations-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","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

Hashes for anatomic_locations-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0dee495a103a09c1b84fe4107f436545c384b6a52bd3416303628c4d82f0dc6e
MD5 5024640f367ba9d6ed497276dccaabd2
BLAKE2b-256 1b457640a5e4068c2a9a207877246b5c260a6e2c969f3125ce95f0c342c44cb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page