Skip to main content

Python client for the Netrias harmonization API

Project description

Netrias Client

"""Explain how to install and exercise the Netrias harmonization client."""

Install with uv

  • Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Create, activate, and sync virtual environment:
uv venv
source .venv/bin/activate
uv sync

"""Use the Netrias to harmonize data via the Netrias API."""

import os
from pathlib import Path
from typing import Final

from dotenv import load_dotenv
from netrias_client import NetriasClient

# Create a Netrias Client and populate it with your API key
netrias_client = NetriasClient(api_key={Insert API key here})

# Point to the csv file to harmonize
CSV_PATH: Final[Path] = Path("data") / "primary_diagnosis_1.csv"

# Determine the data -> CDE mapping
cde_map = netrias_client.discover_cde_mapping(source_csv=CSV_PATH, target_schema="ccdi")

# Harmonize the data
result = netrias_client.harmonize(source_path=CSV_PATH, cde_map=cde_map)
print(f\"Harmonize job id: {result.job_id}\")  # available immediately for tracking
print(f\"Harmonized file: {result.file_path}\")
print(f\"Manifest file: {result.manifest_path}\")

Configuration Options

NetriasClient(...) accepts additional tuning knobs (and you can still call configure(...) to reconfigure an existing instance). You can mix and match the ones you need:

Parameter Type Purpose
api_key str Required. Bearer token for authenticating with the Netrias services.
confidence_threshold `float None`
timeout `float None`
log_level `LogLevel str
discovery_use_gateway_bypass `bool None`
log_directory `Path str

Configure only the options you need; unspecified values fall back to sensible defaults.

Usage Notes

  • discover_cde_mapping(...) samples CSV values and returns a CDE map payload
  • Call harmonize(...) or harmonize_async(...) (async) with the CDE map to download a harmonized CSV and its manifest parquet. The result object reports status, description, and output paths.
  • The package exposes __version__ so callers can assert the installed release.
  • Optional extras (netrias_client[aws]) add boto3 helpers for the temporary gateway bypass.

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

netrias_client-0.0.6.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

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

netrias_client-0.0.6-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

Details for the file netrias_client-0.0.6.tar.gz.

File metadata

  • Download URL: netrias_client-0.0.6.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for netrias_client-0.0.6.tar.gz
Algorithm Hash digest
SHA256 5508cb2ef574eb23a05d456e377d3e0276ed3b1968e56ae988d02a0ece287e12
MD5 617be7ff7c3d009adae9ec7ee1504bb0
BLAKE2b-256 8b12db1c7e76681c855f558de3f8e9eb0f596bb00204a6e2e42598dd0c994e86

See more details on using hashes here.

File details

Details for the file netrias_client-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for netrias_client-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1686ed88982ca7a078a3c7879cc5c5d000402d54d2df823d4be893b04fb5aff4
MD5 bf6a3e298bf44f68c181c754e27f3f15
BLAKE2b-256 566f25b655dd98f3e53c4022bf6ed6bb4a92aea1461bd33d02f9b8bf4cab221a

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