Metadata-Version: 2.4
Name: nophi-ui
Version: 0.1.0
Summary: Local web review interface for nophi / nophi-av PHI redaction
License: MIT
Project-URL: Homepage, https://github.com/kshen3778/no-phi
Project-URL: Repository, https://github.com/kshen3778/no-phi
Keywords: phi,pii,redaction,review,ui
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: nophi>=0.1
Requires-Dist: nophi-av>=0.1
Requires-Dist: fastapi>=0.110
Requires-Dist: uvicorn[standard]>=0.29
Requires-Dist: python-multipart>=0.0.9
Dynamic: license-file

# nophi-ui

A local web review interface for the [`nophi`](../nophi) (documents) and
[`nophi-av`](../nophi-av) (audio/video) PHI redaction engines.

It is a thin FastAPI frontend — the redaction logic stays in the two engines.
It lets you run detection from the browser, **remove false-positive detections**
(and, for audio, add a missed segment by hand) before redaction is applied, and
view the redacted result.

## Run

```bash
nophi-ui            # opens http://127.0.0.1:8000
nophi-ui --port 9000 --no-open
```

You type a server-side **input directory** and **output directory** (raw paths),
preview the files that will be processed, then start detection.

## What it does

- **Documents** (`.txt .csv .docx .xlsx .pdf`): detect → review the detection
  list → uncheck false positives → apply. PDF previews inline; docx/xlsx are
  download-only.
- **Audio**: detect → review (play the original clip per detection) → uncheck
  false positives and/or add missed `start/end` segments → apply (re-scrubs from
  the original; no re-transcription).
- **Video**: view-only. Redacted in one shot; detections shown for reference.

## Security

This tool serves PHI, so by design it:

- binds to **`127.0.0.1` only** (refuses other hosts),
- locks **CORS** to its own origin,
- requires a **per-launch token** on every API call,
- serves files by **opaque job/file id** (never a client-supplied path),
- marks PHI responses **`Cache-Control: no-store`** and serves only the clipped
  segment for audio review.

State is held **in memory** for the process lifetime; closing the server clears
it (a restart means re-running detection).
