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

Uploaded Python 3

File details

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

File metadata

  • Download URL: netrias_client-0.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 d4957f99dea505d4650c92210176ef738a7a602122de3e993e713fbc68151085
MD5 d115956df45f856847f2109a97dc5111
BLAKE2b-256 8aaf15614f9ac6a59b2931fd7e24c0b85e490e0d44194dfa7879607976ecdd4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for netrias_client-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8b5b9564da722b0a5a007452b2e4f4d4b54036306519a097616f3702bc6e54
MD5 d91e32e1bdae12c5b5c157f8796f0899
BLAKE2b-256 e6ec3335f8538d33618c1972c19abdc5d1bbe276cbbb5bdd788ccdd39d2ebabe

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