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

Uploaded Python 3

File details

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

File metadata

  • Download URL: netrias_client-0.0.8.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.8.tar.gz
Algorithm Hash digest
SHA256 86cf75a180cf095a4adbf3e8fdb98b9abd3391be17f7affbe4352dad331ba60a
MD5 14d0c0a85afaf77644b254ab8e05a443
BLAKE2b-256 2fa0135473545c04223b9861d062812c993a1474b70eacac4174e5fe9b10d856

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for netrias_client-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c1fac7d3970410d1a2126b355fa48325980e99fe518b641e2850bb780db1fa24
MD5 e34de913eb0898ce8e8ca0f5528b20f4
BLAKE2b-256 bcf5c83a5badcba3d02909e541b64020f38ea37b8206e021e1328d38914e527c

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