Metadata-Version: 2.4
Name: photoquad-qc
Version: 0.1.0
Summary: Browser UI and FastAPI backend for Photoquad optical QC workflows
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: annotated-doc==0.0.5
Requires-Dist: annotated-types==0.8.0
Requires-Dist: anyio==4.14.2
Requires-Dist: certifi==2026.7.22
Requires-Dist: click==8.4.2
Requires-Dist: colorama==0.4.6
Requires-Dist: fastapi==0.141.1
Requires-Dist: h11==0.16.0
Requires-Dist: httpcore==1.0.9
Requires-Dist: httpx==0.28.1
Requires-Dist: idna==3.18
Requires-Dist: iniconfig==2.3.0
Requires-Dist: Jinja2==3.1.6
Requires-Dist: MarkupSafe==3.0.3
Requires-Dist: numpy==2.5.1
Requires-Dist: packaging==26.3
Requires-Dist: pandas==3.0.5
Requires-Dist: pluggy==1.6.0
Requires-Dist: pydantic==2.13.4
Requires-Dist: pydantic_core==2.46.4
Requires-Dist: Pygments==2.20.0
Requires-Dist: pytest==9.1.1
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: python-multipart==0.0.32
Requires-Dist: six==1.17.0
Requires-Dist: starlette==0.50.0
Requires-Dist: typing-inspection==0.4.2
Requires-Dist: typing_extensions==4.16.0
Requires-Dist: tzdata==2026.3
Requires-Dist: uvicorn==0.52.1
Dynamic: license-file

# photoquad-optical-qc
This app provides a browser UI and FastAPI backend for optical QC workflows, including image renaming, file info extraction, zip packaging, metadata merge checks, and final Optical Validation output prep.

## Features

- Rename images
- Generate File Info CSV
- Create a zip file
- Generate copy-ready SQL for SQL Developer metadata export
- Merge file info CSV and metadata CSV from file paths
- Find sites present in file info but missing from merged metadata or vice versa
- Count images per site 
- Create Optical Validation folder and copy final files

## Quickstart

Run these commands from the repository root:

```powershell
py -3.14 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install .
```

If PowerShell blocks the activation script, run this once in the same terminal:

```powershell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
```

If you do not want to activate a virtual environment, you can install directly with:

```powershell
py -3.14 -m pip install .
```

Once this project is published to PyPI, end users will be able to install it with:

```powershell
pip install photoquad-qc
```

## Run the App Locally

After installation, start the app with:

```powershell
photoquad-qc
```

If your Python Scripts directory is not on PATH, use the module form instead:

```powershell
python -m app
```

Use a different port if needed:

```powershell
photoquad-qc --port 9000
```

Module form with a different port:

```powershell
python -m app --port 9000
```

## Publishing

`pip install photoquad-qc` only works after the package is published to PyPI under that exact name.

Build the release artifacts from the repository root:

```powershell
py -3.14 -m pip install --upgrade build twine
py -3.14 -m build
```

Upload to TestPyPI first:

```powershell
py -3.14 -m twine upload --repository testpypi dist/*
```

Install from TestPyPI to verify the published package:

```powershell
py -3.14 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple photoquad-qc
```

Then publish to PyPI:

```powershell
py -3.14 -m twine upload dist/*
```

For development with auto-reload:

```powershell
photoquad-qc --reload
```

Open the app in your local browser using the same port you started:

```text
http://127.0.0.1:8080
```

You can also use:

```text
http://localhost:8080
```

## Local Usage Workflow

1. Click Choose Folder and select your optical root directory.
2. Confirm exclude folders in the Root Directory section.
3. Run Step 1 to rename images.
4. Run Step 2 to generate the File Info CSV.
5. Run Step 3 to create ZIPPED_IMAGES.zip.
6. Run Step 4 to generate SQL metadata query text.
7. Run Step 5 and Step 6 for merge and missing-file QC.
8. Run Step 7 for zip site counts.
9. Run Step 8 to create Optical Validation outputs.

## Local Troubleshooting

1. If the page does not load, make sure uvicorn is still running.
2. If port 8080 is in use, start on another port and open that port in your browser.
3. If dependencies are missing, activate .venv and re-run python -m pip install .

#### Disclaimer
This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project content is provided on an 'as is' basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

## License
See the [LICENSE.md](https://github.com/Brighton-Hedger-NOAA/photoquad-optical-qc/blob/main/LICENSE.md) for details
