Downloads and processes school directory data from the Pennsylvania Department of Education via the PA Open Data Portal. Returns school and district records with addresses, entity types, grades served, and website URLs.
Value
A tibble with school directory data. When tidy = TRUE, columns include:
aun: Administrative Unit Number (9-digit PDE identifier)school_number: 4-digit school identifier (0000 = district)district_name: LEA/district nameschool_name: School namelea_type: Entity type (School District, Charter School, etc.)entity_type: Simplified type (district, school, charter)county_name: County nameaddress: Street addresscity: Citystate: State (always "PA")zip: ZIP codephone: Phone number (not available from open data portal)grades_served: Grade range (e.g., "K5F-5" or "9-12")website: School/district website URLlatitude: Latitude coordinatelongitude: Longitude coordinateis_district: TRUE if district-level recordis_school: TRUE if school-level recordis_charter: TRUE if charter school entity
Details
Directory data is downloaded from the PA Open Data Portal (data.pa.gov), which publishes PDE's Education Names and Addresses (EdNA) data. Two datasets are joined:
Public and Private Education Institutions (dataset a5nq-sy2w): provides entity type, county, address, and status
EdNA GIS dataset (dataset knsp-q7fv): provides grades served and website URLs
Administrator contact information (superintendent/principal names and emails) is available through the EdNA web application at http://www.edna.pa.gov but is not available via API.
Examples
if (FALSE) { # \dontrun{
# Get school directory data
dir_data <- fetch_directory()
# Get raw format (original PDE column names)
dir_raw <- fetch_directory(tidy = FALSE)
# Force fresh download (ignore cache)
dir_fresh <- fetch_directory(use_cache = FALSE)
# Filter to active school districts only
library(dplyr)
districts <- dir_data |>
filter(is_district)
# Find all schools in Philadelphia
philly_schools <- dir_data |>
filter(aun == "126515001", is_school)
# Charter schools only
charters <- dir_data |>
filter(is_charter)
} # }