Skip to contents

quick acces to metadata of the script, data is not fecthed.

Usage

sourcoise_meta(path, args = NULL)

Arguments

path

(character) path of the script

args

(named list) arguments of the script if any

Value

a named list with cache information

Details

  • timing: time of full script execution

  • date: date of last full execution

  • size: size of objects returned (in R memory)

  • args: args given to sourcoise for the script

  • lapse: dely before reexecution

  • track: list of files tracked

  • qmd_file: list of qmd calling this script

  • log_file: last log file

  • file_size: size of data cached on disk

  • data_date: date of last data save (if no new data when executed, no data is saved)

  • data_file: path to data cached (as a qs2 data file)

  • file: path to the json file storing metadata (and .sourcoise dir)

Examples

dir <- tempdir()
set_sourcoise_root(dir)
#> [1] "/tmp/Rtmpv54Aer"
fs::file_copy(
   fs::path_package("sourcoise", "ipch", "prix_insee.R"),
  dir,
  overwrite = TRUE)
# Force execution (root is set explicitly here, it is normally deduced from project)
data <- sourcoise("prix_insee.R", force_exec = TRUE)
# Then we access metadata
sourcoise_meta("prix_insee.R")
#> $ok
#> [1] "cache ok&valid"
#> 
#> $timing
#> [1] 0.0526
#> 
#> $date
#> [1] "2025-04-05 15:19:16"
#> 
#> $size
#> [1] 13680
#> 
#> $args
#> list()
#> 
#> $lapse
#> [1] "never"
#> 
#> $track
#> list()
#> 
#> $qmd_file
#> named list()
#> 
#> $log_file
#> named list()
#> 
#> $file_size
#> [1] 3373
#> 
#> $data_date
#> [1] "2025-04-05 15:19:16.426536"
#> 
#> $data_file
#> [1] "prix_insee-4262323b_d0beb32c350833a553e922e58f952f5b.qs2"
#> 
#> $json_file
#> /tmp/Rtmpv54Aer/.sourcoise/prix_insee-4262323b_25f9ff25-1.json
#>