Skip to content
This repository was archived by the owner on Jun 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions code/scrape_aclu.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
library(tidyverse)
library(tabulizer)

path <- here::here("input/chasing_justice_report_2021_final.pdf")
get_n_pages(path)
pages <- list(
complaints = 19,
sustained = 20,
q90 = 21
)

# locate_areas(path, pages = pages)
areas <- list(
complaints = list(c(40, 35, 720, 215), c(40, 215, 720, 395), c(40, 395, 705, 575)),
sustained = list(c(160, 47, 657, 563)),
q90 = list(c(280, 40, 650, 305), c(280, 305, 650, 560))
)

dfs <- pmap(list(pages, areas), function(p, ars) {
map(ars, ~extract_tables(path, pages = p, area = list(.x), output = "matrix", method = "lattice"))
}) %>%
map_depth(2, 1)

out <- list()

out$complaints <- map_dfr(dfs$complaints, function(df) {
as.data.frame(df[-1, ]) %>%
set_names(df[1, ])
}) %>%
janitor::clean_names() %>%
select(1:2) %>%
mutate(complaints = parse_number(complaints))

# need to make dummy (\\d) markers to be able to split e.g. Hersl but not Chanoine
out$sustained <- as.data.frame(dfs$sustained[[1]]) %>%
set_names(c("officer", "total_sustained", "desc")) %>%
as_tibble() %>%
mutate(desc = str_squish(desc) %>%
str_replace("(?<!\\))(\\b)$", " (666)") %>%
str_match_all("([A-Z][\\w\\s,/\\-]+ \\(\\d+\\))") %>%
map(~.[,1]),
officer = str_squish(str_remove_all(officer, "\\d+"))) %>%
unnest(desc) %>%
extract(desc, into = c("desc", "sustained"), regex = "(^.+) \\((\\d+)\\)$") %>%
mutate(sustained = na_if(parse_number(sustained), 666))

out$q90 <- map_dfr(dfs$q90, function(df) {
as.data.frame(df[-1, ]) %>%
set_names(df[1, ])
}) %>%
janitor::clean_names() %>%
mutate(across(complaints:use_of_force_incidents, parse_number))

iwalk(out, ~write_csv(.x, file.path("data", "aclu_extract", str_glue("{.y}.csv")), na = ""))
138 changes: 138 additions & 0 deletions data/aclu_extract/complaints.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
officer,complaints
Wayne Jenkins,227
Evodio Hendrix,164
Marcus Taylor,161
Daniel Hersl,130
Maurice Ward,119
Jemell Rayam,107
Steven Mahan,86
Joseph Donato,66
Calvin Moss,63
Edward Creed,56
Momodu Gondo,56
Fabien Laronde,52
Rashard King,50
Benjamin Critzer,49
Charles Baugher,48
Courtney Wright,48
James Klein,47
Steven Foster,45
David Burch,44
Erwin Scofield,42
Richard Guy,40
Sharod Watson,40
Michael Mercado,38
Aisha White-Bey,37
Christopher Lehman,35
Ethan Newberg,33
Joseph Wiczulis,33
Scott Lawrence,32
Brandon Smith-Saxon,32
Richard Watts,32
Ryan Hill,31
Robert Moorhead,31
Rico Perry,31
James Craig,30
Bruce Dhaiti,30
John Gossett,30
Dylan LaPorta,30
Hovhannes Simonyan,30
"Duane Williams, Jr.",30
Shawn Fuksa,29
Ronald Rinehart,29
Andres Severino,29
Joshua Hall,28
Clayton Leak,28
Yolanda Nelson,28
Andres Rodriguez,28
Luke Shelley,28
David Crites,27
Alexander Ames,26
Anthony Weems,25
Clemmie Anderson,24
Betavia Elliott,24
"Frank Friend, Jr.",24
Charles Thompson,24
Adam Tondeur,24
Arthur Williams,24
Derick Allen,23
Scott Armstrong,23
Phoenix Frey,23
Sufian Hassan,23
Denishia Jordan,23
Sherrod Biggers,22
Aaron Dail,22
Ben Frieman,22
Demario Harris,22
Charles Manners,22
Keith Perry,22
Leon Riley,22
Timothy Romeo,22
Carl Ross,22
Kenneth Sanchez,22
Chris Sullivan,22
Norman Jones,21
Ian Meertens,21
Robert Messner,21
Valentine Nagovich,21
Ricardo Ojeda,21
Antonio Saunders,21
Gabriel Barnett,20
Anthony Casabona,20
Brandon Chambers,20
Steven Angelini,19
Alan Chanoine,19
Taulant Halilaj,19
Cody Holliday,19
John Jaimes,19
Tyler Scott,19
Laron Wilson,19
Jorge Bernardez-Ruiz,18
Jamal Brunson,18
Eric Dodson,18
James Edge,18
Mark Gurbelski,18
Stephen Halstead,18
"Thomas Hodas, Jr.",18
Jason Leventhal,18
Rafiu Makanjuola,18
David MacNeill,18
Phillip McMorris,18
Michael Nolan-Anderson,18
"Lonnie White, Jr.",18
Devin Yancy,18
Nicholas Betz,17
Kevin Brown,17
Bryan Chenowith,17
David Ciotti,17
Morgan Clasing,17
Orice Custis,17
"Gary Fanning, Jr.",17
Johnta Gray,17
Darrell London,17
Jamil Shakir,17
Kurt Yourkovik,17
Jason Zimmerman,17
Bijay Ranabhat,16
Aaron Cain,16
Jordan Distance,16
Deonte Duck,16
Kyle Gaskin,16
Michael Jones,16
Supreme Jones,16
Akeem Nelson,16
Paulo Pereira,16
Brandon Sanchez,16
Gregory Shuttleworth,16
Charles Smith,16
Christopher Amsel,15
Jacob Antignano,15
Darius Carter,15
Nicholas De Jesus,15
Gregory Edleman,15
Colin Harner,15
Thomas Kirby,15
Brian Loiero,15
"Thomas Mistysyn, Jr.",15
Darryl Parker,15
Giusseppe Polanco,15
45 changes: 45 additions & 0 deletions data/aclu_extract/q90.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
officer,complaints,use_of_force_incidents
Benjamin Critzer,49,82
James Klein,47,46
Steven Foster,45,44
"David Burch, Jr.",44,55
Erwin Scofield,42,53
Ryan Hill,31,41
Hovhannes Simonyan,30,120
James Craig,30,76
John Gossett,30,51
Andres Rodriguez,28,99
Luke Shelley,28,67
Scott Armstrong,23,59
Leon Riley,22,63
Aaron Dail,22,40
Gabriel Barnett,20,50
Taulant Halilaj,19,51
Cody Holliday,19,45
Jason Leventhal,18,93
Mark Gurbelski,18,52
Michael Nolan-Anderson,18,50
Jamil Shakir,17,60
Kurt Yourkovik,17,51
Charles Smith,16,113
Deonte Duck,16,75
Brandon Sanchez,16,72
Paulo Pereira,16,40
Gregory Edleman,15,92
Brian Loiero,15,90
Giusseppe Polanco,15,68
Christopher Amsel,15,65
Thomas Kirby,15,47
Colin Harner,15,46
Jacob Antignano,15,43
James Deasel,14,80
Nicholas Yinger,14,76
David Colburn,14,65
Donald Waldron,14,61
Daniel Waskiewicz,14,47
Kevin Fassl,14,44
Jeffrey Santos,13,55
Victor Villafane,13,55
Tyler Sentz,12,62
James Kostoplis,12,51
Richard Whittaker,12,51
65 changes: 65 additions & 0 deletions data/aclu_extract/sustained.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
officer,total_sustained,desc,sustained
Rashard King,40,Discourtesy,7
Rashard King,40,False Arrest/Imprisonment,6
Rashard King,40,Assault,3
Rashard King,40,Firearms Regulations,3
Rashard King,40,Medical Leave Violation,2
Rashard King,40,DUI,1
Jemell Rayam,38,False Arrest/Imprisonment,5
Jemell Rayam,38,Theft,5
Jemell Rayam,38,False Report,4
Jemell Rayam,38,Harassment,3
Jemell Rayam,38,Assault,1
Jemell Rayam,38,Excessive Force,1
Jemell Rayam,38,Reckless Driving,1
Wayne Jenkins,36,False Arrest/Imprisonment,6
Wayne Jenkins,36,Improper Stop/Search/Seizure,4
Wayne Jenkins,36,Theft,4
Wayne Jenkins,36,False Report,3
Wayne Jenkins,36,Harassment,3
Wayne Jenkins,36,Hit and Run,1
Wayne Jenkins,36,Racial Bias,1
Fabien Laronde,35,Assault,3
Fabien Laronde,35,Theft,3
Daniel Hersl,34,Theft,4
Daniel Hersl,34,False Statement,4
Daniel Hersl,34,False Arrest/Imprisonment,3
Daniel Hersl,34,Excessive Force,1
Erwin Scofield,26,Unnecessary Force,5
Carl Ross,22,Child Pornography,11
Duane Williams,18,Assault,4
Duane Williams,18,Child Abuse,4
Duane Williams,18,Excessive Force,1
Bijay Ranabhat,13,False Statement,4
Bijay Ranabhat,13,Nonfeasance,4
Robert Mesner,12,Assault,3
Robert Mesner,12,False Arrest/Imprisonment,3
Robert Mesner,12,Malfeasance in Officer,3
Paulo Pereira,12,Improper Stop/Search/Seizure,3
"Lonnie White, Jr.",12,False Statement,4
"Lonnie White, Jr.",12,Nonfeasance,4
Calvin Moss,11,Abusive or Discriminatory Language,2
Steven Angelini,10,Inappropriate Comments,4
"David Burch, Jr.",10,Vehicle Pursuit,1
Sherrod Biggers,10,Improper Stop/Search/Seizure,3
Damon Cephus,10,False Arrest/Imprisonment,2
Momodu Gondo,10,False Arrest/Imprisonment,2
Ezekiel Abdi,9,Failure to Supervise,3
Ezekiel Abdi,9,Neglect of Duty,3
Jacob Antignano,9,Excessive Force,1
Jacob Antignano,9,Unnecessary Force,1
Brandon Chambers,9,Neglect/Body-Worn Camera,4
Frank Schneider,9,Inappropriate Comment,3
Frank Schneider,9,Neglect of Duty,3
Adam Tondeur,9,Failure to Supervise,2
Adam Tondeur,9,Neglect/Firearms Related,2
Adam Tondeur,9,Neglect/Prisoner Related,2
Kyle Gaskin,8,Failure to Supervise,4
Kyle Gaskin,8,Neglect of Duty,4
Valentine Nagovich,8,"DUI, DWI, Armed While Intoxicated, Negligent Driving, Failure to Stop for Police Vehicle",
Yolanda Nelson,8,Neglect/Body-Worn Camera,5
Alan Chanoine,7,"Inappropriate comments, Profanity, or Gestures to a Departmental Member",3
Stephen Halstead,7,Neglect of Duty,5
Dylan LaPorta,7,Vehicle Pursuit,1
Dylan LaPorta,7,Unsafe Operation of Departmental Vehicle,1
Spencer Moore,7,Violation of Criminal Statute,2
Binary file added input/chasing_justice_report_2021_final.pdf
Binary file not shown.