Skip to content

itsmevictor/frjustadmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frjustadmin

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/.

Installation

You can install the development version of frjustadmin from GitHub with:

# install.packages("devtools")
devtools::install_github("itsmevictor/frjustadmin")

Usage

The package has two main functions: download_decisions and read_decisions.

Downloading Decisions

The download_decisions function supports both specific downloads and bulk downloads using wildcards (*).

Specific Downloads

To download decisions from a specific jurisdiction, year, and month:

library(frjustadmin)

download_decisions(jurisdiction = "CAA", year = 2022, month = 3, download_dir = "my_data")

Bulk Downloads with Wildcards

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 = "*")

Options

  • skip_existing = TRUE (default): Skip files that have already been downloaded
  • download_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.

Reading Decisions

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:

  • identification
  • code_juridiction
  • nom_juridiction
  • numero_dossier
  • date_lecture
  • type_decision
  • solution
  • texte_integral

About

A simple R package to facilitate the downloading and processing of French administrative Court decisions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages