Documentation navigation

Exporting and interpreting CSV alerts

Application version: 1.0.0Documentation version: 1.0.3Last technical review: 2026-10-17View Source Code on GitHub →

Written by Elena David, SEO, ORM, and AI Visibility Consultant.

A successful default run writes reports/alerts.csv. The file contains only newly detected reviews at or below the selected maximum alert rating.

Alert schema

Field Output value
review_id Stable identifier from the input.
practice_id Practice identifier from the input.
practice_name Practice name from the input.
review_date Parsed date written in YYYY-MM-DD form.
rating Validated integer rating.
review_text Review text from the input.
source_label Source label from the input.
alert_reason Text generated from the selected threshold, such as New review rated 1 or 2 stars.

The writer uses UTF-8 and Python's CSV handling, which quotes values when required.

Supplied output

The bundled snapshots produce:

review_id,practice_id,practice_name,review_date,rating,review_text,source_label,alert_reason
REV-016,PR-001,Cabinet Médical des Tilleuls,2026-10-01,1,I could not understand the fictional booking confirmation,Example Reviews,New review rated 1 or 2 stars
REV-018,PR-005,Pôle Médical Lumière,2026-10-05,2,The fictional waiting time was longer than announced,Sample Feedback,New review rated 1 or 2 stars

All names and review content in this example are fictional.

Inspect the file with Python

python -c "from pathlib import Path; print(Path('reports/alerts.csv').read_text(encoding='utf-8'))"

To count data rows using the same CSV parser family as the application:

python -c "import csv; f=open('reports/alerts.csv', encoding='utf-8'); print(sum(1 for _ in csv.DictReader(f))); f.close()"

The supplied file should report 2.

File behavior

  • The output directory is created when it does not exist.
  • The file is opened in write mode, so a later run to the same directory replaces it.
  • When there are no alerts, the file still contains the header row.
  • The file does not record the generation timestamp or input paths. Alert rows describe the selected threshold in alert_reason; a header-only file has no threshold-bearing row.

Use separate output directories or an external archival process when individual runs must be retained.

Threshold labels

alert_reason describes every rating included by --maximum-rating. For example, threshold 1 produces New review rated 1 star, while threshold 5 produces New review rated 1, 2, 3, 4, or 5 stars. Preserve the command when complete run provenance is required because the CSV does not otherwise store its input paths or generation timestamp.

Responsible downstream use

The export can be opened in a spreadsheet or read by another authorized process. Do not interpret the alert reason as a finding about accuracy, legality, or medical importance. Protect any operational dataset according to its sensitivity and avoid enriching it with patient or health data.

For all input and output constraints, see the data reference.