Skip to contents

Makes a complete archive zip that was downloaded by other means (for example in a browser) available to lamp_archive_snapshot() without copying it: the zip is listed and every member becomes readable in place.

Usage

lamp_archive_register(path, dir = lamp_cache_dir(), md5 = NA_character_)

Arguments

path

Path to a zip named like the archive it came from, for example 2026-07.zip; the name gives the archive identifier.

dir

Cache directory; see lamp_cache_dir().

md5

Optional published checksum to record with the archive.

Value

The archive identifier, invisibly.

Examples

cache <- tempfile("streetlamp-cache-")
zip <- system.file("extdata", "archive", "2026-07.zip", package = "streetlamp")
lamp_archive_register(zip, dir = cache)
#> Registered archive "2026-07" from
#> /home/runner/work/_temp/Library/streetlamp/extdata/archive/2026-07.zip.
lamp_archive_snapshot(cache)
#> 
#> ── streetlamp archive snapshot 
#> Cache: /tmp/RtmpjpgtJA/streetlamp-cache-1cb02002a9cd
#> 1 archive: "2026-07"
#> 15 force-month files covering 2 forces, 2026-05 to 2026-07; 15 available
#> locally.
#>   outcomes: 6 of 6 available
#>   stop-and-search: 3 of 3 available
#>   street: 6 of 6 available