Package 'cozip'

Title: Cloud-Optimized ZIP - Open a ZIP Like a Table
Description: R bindings to libcozip, the reference library for the Cloud-Optimized ZIP (cozip) format.
Authors: Cesar Aybar [aut, cre], Roy Yali [aut], Julio Contreras [aut]
Maintainer: Cesar Aybar <[email protected]>
License: MIT + file LICENSE
Version: 2026.5.22
Built: 2026-05-22 05:45:05 UTC
Source: https://github.com/asterisk-labs/cozip

Help Index


Write a cozip archive in one call

Description

Wraps stage_metadata() + arrow::write_parquet() + stage_create(). For GeoParquet or custom write options, use the staging functions directly.

Usage

create(out_path, table, temp_dir = NULL)

write(out_path, table, temp_dir = NULL)

Arguments

out_path

Destination archive path.

table

arrow::Table with name and path.

temp_dir

Directory for the temp metadata parquet (defaults to tempdir()).

Value

Absolute path of the created archive.


Read the manifest of a FLAT-profile cozip archive

Description

Thin wrapper around the DuckDB cozip extension. name, offset, size (and cozip:gdal_vsi when gdal_vsi = TRUE) are always included; use columns to bring extras, NULL brings all.

Usage

read(source, columns = NULL, gdal_vsi = TRUE)

Arguments

source

Local path or http(s)/s3/gcs/azure/hf URL to the .zip.

columns

Character vector of extra columns. NULL returns every column.

gdal_vsi

Include the cozip:gdal_vsi column.

Value

A tibble.


Pack a cozip archive from sources and a user-written parquet

Description

The metadata parquet is embedded verbatim, so any GeoParquet or schema metadata you wrote is preserved.

Usage

stage_create(out_path, paths, metadata_parquet, validate = TRUE)

Arguments

out_path

Destination archive path.

paths

data.frame with name and path in the same row order as metadata_parquet.

metadata_parquet

Path to a parquet with name, offset, size columns and no path column.

validate

If TRUE, re-runs the plan and checks that the parquet matches.

Value

Absolute path of the created archive.


Plan a cozip FLAT archive

Description

Computes offsets and sizes for the user entries and returns the canonical metadata table plus a row-aligned paths data.frame. No I/O.

Usage

stage_metadata(table)

Arguments

table

arrow::Table with name and path. Extras are preserved in the metadata.

Details

If you reorder metadata before writing it, reorder paths the same way or stage_create() will reject the mismatch.

Value

List with metadata (arrow::Table) and paths (data.frame).