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.9.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.9-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netrias_client-0.0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 4c287e11264dbad3570a974b26fb0caba1662db6cbbd0d704ada5bcded02d5f6
MD5 3a7e3f42091b10a1211932cdc4e7a096
BLAKE2b-256 68fe60fd407ff0498624990004f991e1d4e07ffec0dfa7c4228756a3fae32188

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for netrias_client-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 bae328633ee4b8d68a072394cb401c867a1a1eb830f0ca15bb65fb3b3da1c280
MD5 c01c7152149745bd69572490c2fb4eb2
BLAKE2b-256 22d5518bccfc1282d5898a48433c159973645b45d5dccf8af2dd32371953a3f3

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