{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# SheetReview\n", "\n", "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Unique50101/unique-sheetreview/blob/main/SheetReview.ipynb) [![Launch Jupyter](https://img.shields.io/badge/Jupyter-launch-F37626?logo=jupyter&logoColor=white)](https://mybinder.org/v2/gh/Unique50101/unique-sheetreview/main?urlpath=lab%2Ftree%2FSheetReview.ipynb) [![Open in VS Code](https://img.shields.io/badge/VS_Code-open-007ACC)](https://vscode.dev/github/Unique50101/unique-sheetreview/blob/main/SheetReview.ipynb)\n", "\n", "Run the cells in order. Choose a CSV or Excel file, review the findings and download the annotated workbook." ] }, { "cell_type": "code", "metadata": {}, "source": [ "%pip -q install --upgrade unique-interface\n", "%pip -q install \"unique-sheetreview[notebook]==0.1.1\"" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": {}, "source": [ "try:\n", " from google.colab import output\n", "except ImportError:\n", " pass\n", "else:\n", " output.enable_custom_widget_manager()" ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": {}, "source": [ "from unique_sheetreview.notebook import launch_review\n", "\n", "panel = launch_review()" ], "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Run a sample without uploading a file" ] }, { "cell_type": "code", "metadata": {}, "source": [ "from pathlib import Path\n", "from tempfile import mkdtemp\n", "from unique_sheetreview import scan\n", "from openpyxl import load_workbook\n", "\n", "folder = Path(mkdtemp())\n", "source = folder / \"orders.csv\"\n", "source.write_text(\"OrderID,OrderDate,Customer\\n101,04/05/2026, Asha\\n101,2026-05-04,Amir\\n,2026-05-05,Sam\\n\", encoding=\"utf-8\")\n", "report = scan(source, required=[\"OrderID\"], unique=[\"OrderID\"])\n", "print(report)\n", "review = report.save_review_copy(folder / \"orders_review.xlsx\")\n", "assert len(report.findings) == 5 and load_workbook(review).active[\"A2\"].comment\n", "print(\"Review workbook:\", review)" ], "execution_count": null, "outputs": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 4 }