A simple, Dockerized web application for viewing and searching police accountability data from IAPro CSV files.
- Search by Officer Name: Type an officer's name to see all related cases, allegations, and outcomes
- Filter by Allegation: Filter records by allegation type
- Filter by Incident Type: Filter records by incident type/department
- Combined Filtering: Use multiple filters together for precise searches
- Responsive Interface: Works on desktop and mobile devices
- Real-time Search: Search results update as you type (with HTMX)
-
Clone the repository:
git clone <repository-url> cd iapro-viewer
-
Build and run with Docker Compose:
docker-compose up -d
-
Access the application: Open your browser and navigate to: http://localhost:8000
-
Stop the application:
docker-compose down
- Python 3.11+
- pip
-
Install dependencies:
pip install -r requirements.txt
-
Run the development server:
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload
-
Access the application: Open your browser and navigate to: http://127.0.0.1:8000
- Enter an officer's name in the search box (e.g., "Smith")
- Results will appear automatically as you type
- View all cases, allegations, and outcomes for that officer
- Select an allegation type from the dropdown (e.g., "Professionalism")
- Click "Search" or let it auto-update
- View all records matching that allegation
- Enter an officer name
- Select an allegation type
- Select an incident type
- View records matching all criteria
- Click the "Clear" button to reset all search criteria
The application displays the following fields from the IAPro CSV:
| Field | Description |
|---|---|
| File Number | Unique case identifier |
| Officer Name | Name of the officer involved |
| Allegation | Type of allegation |
| Finding | Investigation finding |
| Discipline | Disciplinary action taken |
| Occurred Date | Date the incident occurred |
| Incident Type | Type/category of incident |
- Backend: FastAPI (Python)
- Data Processing: pandas
- Frontend: HTMX for interactivity
- Styling: Custom CSS
- Deployment: Docker + Docker Compose
iapro-viewer/
├── app/
│ ├── main.py # FastAPI application
│ ├── data_loader.py # CSV data loader and filter logic
│ ├── templates/ # Jinja2 HTML templates
│ │ ├── index.html # Main search interface
│ │ └── partials/ # HTMX partial responses
│ │ └── results.html # Search results table
│ └── static/ # CSS and static assets
│ └── style.css
├── data/
│ └── iapro-data.csv # Police accountability data (21,723 records)
├── Dockerfile # Docker image configuration
├── docker-compose.yml # Docker orchestration
├── requirements.txt # Python dependencies
└── README.md
To update the CSV data:
- Replace
data/iapro-data.csvwith your new CSV file - Ensure the CSV has the same column names
- Restart the application:
- Docker:
docker-compose restart - Local: Restart the uvicorn server
- Docker:
The application will automatically reload the new data.
Check if the application is running and data is loaded:
curl http://localhost:8000/healthResponse:
{
"status": "healthy",
"records_loaded": 21723
}See LICENSE file for details.