codeforboston / codeforboston/police-data-trust

[FEATURE] Aggregate Metrics API

Open
#493 0 comments 0 reactions 1 assignee Claimed by @DMalone87 View on GitHub
Dominant language
Python
Stars
64
Forks
102
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
As a user, I'd like to be able to see the aggregate metrics related to a specific node. For example, I may want to know the total number of allegations made against an officer. I might also want to know the breakdown of what types of allegations have been reported.

Enabling this will require an API request that returns this sort of data for a given officer, agency, or unit.

**Describe the solution you'd like**
An API endpoint for officers, agencies, and units that provides aggregate data about these nodes.

Endpoints:

- `officers/{officer_uid}/metrics`
- `agencies/{agency_uid}/metrics`
- `units/{unit_uid}/metrics`

Metrics desired:
Officers

Complaints received over time
For example: 15 in 2020, 50 in 2021, 30 in 2022, etc.

Allegations final statuses as a percentage
For example: 200 total allegations. 20% Sustained, 20% Unfounded, 60% Pending

Complainant Demographics
Example: 30% White, 30% African Ameraican, 20% Asian, etc.

**Additional context**
Officer Allegations Design

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.