Biosample Enricher Documentation

Infer AI-friendly environmental and geographic metadata about biosamples from multiple sources.

Python Version License: MIT PyPI version

Overview

Biosample Enricher provides 8 specialized services for enriching biosample metadata with environmental and geographic information from authoritative data sources. Each service focuses on a specific domain and returns structured, type-safe data ready for analysis or AI applications.

Features

  • 8 Specialized Services: Elevation, soil, weather, marine, land cover, forward/reverse geocoding, geographic features

  • Service-Based Architecture: Independent services with focused responsibilities

  • Type Safety: Full type hints with Pydantic validation and mypy checking

  • Smart Caching: HTTP caching with coordinate canonicalization for efficiency

  • Multiple Providers: Automatic fallback between data providers (USGS, Google, OSM, etc.)

  • Click-Based CLIs: User-friendly command-line tools for each service

  • Flexible Installation: Core services only, or add optional mongodb/metrics/schema extras

Installation

Using Pip

pip install biosample-enricher
pip install biosample-enricher[metrics]

Quick Start

from biosample_enricher import ElevationService, ElevationRequest

# Get elevation for a location
service = ElevationService()
request = ElevationRequest(latitude=40.7128, longitude=-74.0060)
observations = service.get_elevation(request)

for obs in observations:
    if obs.value_numeric is not None:
        print(f"{obs.provider.name}: {obs.value_numeric}m")

Project Info

Indices and tables