frjustadmin is an R package for downloading and reading open data from the French administrative courts. The data is sourced from the official open data portal: https://opendata.justice-administrative.fr/.
You can install the development version of frjustadmin from GitHub with:
# install.packages("devtools")
devtools::install_github("itsmevictor/frjustadmin")The package has two main functions: download_decisions and read_decisions.
The download_decisions function supports both specific downloads and bulk downloads using wildcards (*).
To download decisions from a specific jurisdiction, year, and month:
library(frjustadmin)
download_decisions(jurisdiction = "CAA", year = 2022, month = 3, download_dir = "my_data")You can use "*" as a wildcard to download multiple files at once:
# Download all months for CAA in 2022 (creates CAA_2022_01/, CAA_2022_02/, etc.)
download_decisions(jurisdiction = "CAA", year = 2022, month = "*")
# Download March 2022 decisions from all courts (creates TA_2022_03/, CAA_2022_03/, CE_2022_03/)
download_decisions(jurisdiction = "*", year = 2022, month = 3)
# Download all available data (will prompt for confirmation)
download_decisions(jurisdiction = "*", year = "*", month = "*")skip_existing = TRUE(default): Skip files that have already been downloadeddownload_dir: Directory where files will be saved (default: "data/raw_data")
Organized Storage: Each download creates a separate folder with the format jurisdiction_year_month (e.g., CAA_2022_03/) to keep your data organized.
Safety Feature: Downloads involving many files (>50) will prompt for confirmation before proceeding.
Once you have downloaded the data, you can use the read_decisions function to parse the XML files into a tidy data frame. You can specify exactly what data to read using the same parameters as the download function:
library(frjustadmin)
# Read specific jurisdiction, year, and month
decisions <- read_decisions(jurisdiction = "CAA", year = 2022, month = 3)
# Read all months for CAA in 2022
decisions <- read_decisions(jurisdiction = "CAA", year = 2022, month = "*")
# Read March 2022 decisions from all courts
decisions <- read_decisions(jurisdiction = "*", year = 2022, month = 3)
# Read all available data
decisions <- read_decisions(jurisdiction = "*", year = "*", month = "*")
head(decisions)This will return a tibble with the following columns:
identificationcode_juridictionnom_juridictionnumero_dossierdate_lecturetype_decisionsolutiontexte_integral