netrias_client 0.0.3__py3-none-any.whl → 0.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of netrias_client might be problematic. Click here for more details.

@@ -6,4 +6,4 @@ from ._client import NetriasClient
6
6
 
7
7
  __all__ = ["NetriasClient", "__version__"]
8
8
 
9
- __version__ = "0.0.3"
9
+ __version__ = "0.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netrias_client
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Python client for the Netrias harmonization API
5
5
  Project-URL: Homepage, https://github.com/netrias/netrias_client
6
6
  Project-URL: Repository, https://github.com/netrias/netrias_client
@@ -56,33 +56,17 @@ Description-Content-Type: text/markdown
56
56
  """Explain how to install and exercise the Netrias harmonization client."""
57
57
 
58
58
  ## Install with `uv`
59
- - Install `uv` once (or update): `curl -LsSf https://astral.sh/uv/install.sh | sh`
60
- - Sync dependencies for a project that consumes the client:
61
- ```bash
62
- uv add netrias_client
63
- uv add python-dotenv # optional helper for loading .env files
64
- ```
65
- - Prefer `uv run <command>` for executing scripts so the managed environment is reused automatically.
66
-
67
- ### Alternative: `pip`
68
- ```bash
69
- python -m pip install netrias_client
70
- python -m pip install python-dotenv # optional
59
+ - Install `uv`: `curl -LsSf https://astral.sh/uv/install.sh | sh`
60
+ - Create, activate, and sync virtual environment:
61
+ ```
62
+ uv venv
63
+ source .venv/bin/activate
64
+ uv sync
71
65
  ```
72
66
 
73
- ## Quickstart Script
74
- Reference script (save as `main.py`) showing a full harmonization round-trip:
75
-
76
- ```python
77
- #!/usr/bin/env -S uv run python
78
- # /// script
79
- # requires-python = ">=3.13"
80
- # dependencies = ["netrias_client", "python-dotenv"]
81
- # ///
82
-
83
- """Exercise the packaged Netrias client against the live APIs."""
67
+ """Use the Netrias to harmonize data via the Netrias API."""
84
68
 
85
- import asyncio
69
+ ```
86
70
  import os
87
71
  from pathlib import Path
88
72
  from typing import Final
@@ -90,64 +74,37 @@ from typing import Final
90
74
  from dotenv import load_dotenv
91
75
  from netrias_client import NetriasClient
92
76
 
93
- load_dotenv(override=True)
94
-
95
- CSV_PATH: Final[Path] = Path("data/primary_diagnosis_1.csv")
77
+ # Create a Netrias Client and populate it with your API key
78
+ netrias_client = NetriasClient()
79
+ netrias_client.configure(api_key={Insert API key here})
96
80
 
81
+ # Point to the csv file to harmonize
82
+ CSV_PATH: Final[Path] = Path("data") / "primary_diagnosis_1.csv"
97
83
 
98
- async def main() -> None:
99
- client = NetriasClient()
100
- client.configure(api_key=_resolve_api_key())
84
+ # Determine the data -> CDE mapping
85
+ manifest = netrias_client.discover_cde_mapping(source_csv=CSV_PATH, target_schema="ccdi")
101
86
 
102
- manifest = await client.discover_cde_mapping_async(
103
- source_csv=CSV_PATH,
104
- target_schema="ccdi",
105
- )
106
-
107
- _ = await client.harmonize_async(
108
- source_path=CSV_PATH,
109
- manifest=manifest,
110
- )
111
-
112
-
113
- def _resolve_api_key() -> str:
114
- api_key = os.getenv("NETRIAS_API_KEY")
115
- if api_key:
116
- return api_key
117
- msg = "Set NETRIAS_API_KEY in your environment or .env file"
118
- raise RuntimeError(msg)
119
-
120
-
121
- if __name__ == "__main__":
122
- asyncio.run(main())
87
+ # Harmonize the data
88
+ result = netrias_client.harmonize(source_path=CSV_PATH, manifest=manifest)
123
89
  ```
124
90
 
125
- ### Steps
126
- 1. Install or update `uv` (see above).
127
- 2. Export `NETRIAS_API_KEY` (or add it to a local `.env`).
128
- 3. Adjust `CSV_PATH` to point at the source CSV you want to harmonize.
129
- 4. Run `uv run python main.py`.
130
-
131
- The client logs its configuration (minus secrets) during `configure(...)` and
132
- reports harmonization status plus output paths as the workflow progresses, so
133
- no extra print statements are required.
134
91
 
135
- ## `configure()` Options
92
+ ## Configuration Options
136
93
  `NetriasClient.configure(...)` accepts additional tuning knobs. You can mix and match the ones you need:
137
94
 
138
95
  | Parameter | Type | Purpose |
139
96
  | --- | --- | --- |
140
97
  | `api_key` | `str` | **Required.** Bearer token for authenticating with the Netrias services. |
141
- | `timeout` | `float | None` | Override the default 6-hour timeout for long-running harmonization jobs. |
98
+ | `confidence_threshold` | `float | None` | Minimum score (0.0–1.0) for keeping discovery recommendations; lower it to capture more tentative matches. |
99
+ | `timeout` | `float | None` | Override the default timeout for harmonization jobs. |
142
100
  | `log_level` | `LogLevel | str | None` | Control verbosity (`INFO` by default). Accepts enum members or string names. |
143
- | `confidence_threshold` | `float | None` | Minimum score (0–1) for keeping discovery recommendations; lower it to capture more tentative matches. |
144
- | `discovery_use_gateway_bypass` | `bool | None` | Toggle the temporary AWS Lambda bypass path for discovery (defaults to `True`). Set to `False` once API Gateway limits are sufficient. |
101
+ | `discovery_use_gateway_bypass` | `bool | None` | Toggle the temporary AWS Lambda bypass path for discovery (defaults to `True`). |
145
102
  | `log_directory` | `Path | str | None` | Directory for per-client log files. When omitted, logs stay on stdout. |
146
103
 
147
104
  Configure only the options you need; unspecified values fall back to sensible defaults.
148
105
 
149
106
  ## Usage Notes
150
- - `discover_cde_mapping_async(...)` samples CSV values and returns a manifest-ready payload; call `discover_cde_mapping(...)` only from non-async code paths.
151
- - Call `harmonize(...)` (sync) or `harmonize_async(...)` (async) with the manifest to download a harmonized CSV. The result object reports status, description, and the output path.
107
+ - `discover_cde_mapping(...)` samples CSV values and returns a manifest-ready payload
108
+ - Call `harmonize(...)` or `harmonize_async(...)` (async) with the manifest to download a harmonized CSV. The result object reports status, description, and the output path.
152
109
  - The package exposes `__version__` so callers can assert the installed release.
153
110
  - Optional extras (`netrias_client[aws]`) add boto3 helpers for the temporary gateway bypass.
@@ -1,4 +1,4 @@
1
- netrias_client/__init__.py,sha256=_4iPH1eQ3gV8puWEWPugQ4S511CJQhE5hG-qZEvSlyg,200
1
+ netrias_client/__init__.py,sha256=RZ0Po6psf3qRgt8TU41teKOooC_7FXlgKVDRV7we1ts,200
2
2
  netrias_client/_adapter.py,sha256=dXJqrpkaAOiZI25gZm0RzFrSFaG4VefvLiM66oI4ziU,9241
3
3
  netrias_client/_client.py,sha256=A-hHSzL9RndvppxfXC-Ak1AaQ_AtWOX5g8hIjLCeZ6w,10142
4
4
  netrias_client/_config.py,sha256=jY12kLOJ3OMn1YF7QeEq6nU2BaXCpPteoXDz7eprB8I,3098
@@ -12,8 +12,8 @@ netrias_client/_logging.py,sha256=5-lhBgp2hWp2K5ZTzz_ZwhJn_sxhSe_t__kdhuMTJnQ,13
12
12
  netrias_client/_models.py,sha256=w_t-rpenLFZiBzLCdRlXaKPqgCrHCjAVoeXjPYF7wIY,1736
13
13
  netrias_client/_validators.py,sha256=DvbaQ1Wkf4-W_H5A2PGiC-AxPN2tfpRFpH8vjETGIno,5894
14
14
  netrias_client/scripts.py,sha256=jAdREIRbyuSvuvZt6tbRZ9ELfOzQyW9ZQcf2j2HIlsE,11113
15
- netrias_client-0.0.3.dist-info/METADATA,sha256=qxRjnnIATXRx66BJuN7SKWs0BnO70VR72pCC4YtqevM,6277
16
- netrias_client-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- netrias_client-0.0.3.dist-info/entry_points.txt,sha256=q7Uj2UATtRzlxefJNziCJQ9RXScH8MQzzWvA86Hfytc,162
18
- netrias_client-0.0.3.dist-info/licenses/LICENSE,sha256=XzmWyunEynTK9hABeKX_9VEd1WcKSDQAM4IXIS-n8WU,1064
19
- netrias_client-0.0.3.dist-info/RECORD,,
15
+ netrias_client-0.0.4.dist-info/METADATA,sha256=6InWSEcx7m-sN4FtKr7xZDpW_QUkcf13cswao47hDts,4950
16
+ netrias_client-0.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ netrias_client-0.0.4.dist-info/entry_points.txt,sha256=q7Uj2UATtRzlxefJNziCJQ9RXScH8MQzzWvA86Hfytc,162
18
+ netrias_client-0.0.4.dist-info/licenses/LICENSE,sha256=XzmWyunEynTK9hABeKX_9VEd1WcKSDQAM4IXIS-n8WU,1064
19
+ netrias_client-0.0.4.dist-info/RECORD,,