Skip to content

Commit

Permalink
add 2023 tax bills
Browse files Browse the repository at this point in the history
  • Loading branch information
erhla committed Jul 11, 2024
1 parent c0b4294 commit a49e2f6
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 9 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 11 additions & 7 deletions data-raw/sample_tax_bills/sample_tax_bills_detail.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ row_to_names <- function(df) {

# Different tax bills can have different table sizes depending on the number of
# taxing district.
extract_tax_bill <- function(file) {

extract_tax_bill <- function(file){

Check warning on line 30 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=30,col=35,[brace_linter] There should be a space before an opening curly brace.

Check warning on line 30 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=30,col=35,[paren_body_linter] There should be a space between a right parenthesis and a body expression.
base_file <- basename(file)
tbl <- pdf_text(file)[[1]] %>%
tbl <- pdf_text(file) %>%
paste(., collapse='\n') %>%

Check warning on line 33 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=33,col=22,[infix_spaces_linter] Put spaces around all infix operators.

Check warning on line 33 in data-raw/sample_tax_bills/sample_tax_bills_detail.R

View workflow job for this annotation

GitHub Actions / lint

file=data-raw/sample_tax_bills/sample_tax_bills_detail.R,line=33,col=23,[quotes_linter] Only use double-quotes.
str_extract(., regex("MISCELLANEOUS TAXES.*", dotall = TRUE)) %>%
str_split(., "\n") %>%
unlist() %>%
Expand All @@ -46,12 +48,12 @@ extract_tax_bill <- function(file) {
agency_name = str_squish(agency_name),
flag = is.na(prev_tax),
prev_tax = if_else(flag,
pension,
prev_tax
pension,
prev_tax
),
pension = if_else(flag,
NA,
pension
NA,
pension
)
) %>%
select(-flag) %>%
Expand All @@ -61,7 +63,8 @@ extract_tax_bill <- function(file) {
agency_name,
paste0(
"TAXES|Assess|Property|EAV|Local Tax|",
"Total Tax|Do not|Equalizer|cookcountyclerk.com"
"Total Tax|Do not|Equalizer|cookcountyclerk.com|",
"Pursuant|meaning of|If paying later|\\d{15}+|By \\d{2}/"
)
)
)
Expand All @@ -76,6 +79,7 @@ extract_tax_bill <- function(file) {
return(out)
}


# Collect all scanned tables + meta data in a data frame
bills <- map(list_pdf_inputs, extract_tax_bill)
bills_df <- bind_rows(bills)
Expand Down
4 changes: 2 additions & 2 deletions data-raw/sample_tax_bills/sample_tax_bills_detail.csv
Git LFS file not shown
Binary file modified data/sample_tax_bills_detail.rda
Binary file not shown.

0 comments on commit a49e2f6

Please sign in to comment.