archive

R bindings to libarchive, supporting a large variety of archive formats

https://github.com/r-lib/archive

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.4%) to scientific vocabulary

Keywords

compression connections libarchive r

Keywords from Contributors

data-manipulation visualisation odbc grammar coverage-report package-creation curl date-time documentation-tool c-plus-plus-11
Last synced: 6 months ago · JSON representation

Repository

R bindings to libarchive, supporting a large variety of archive formats

Basic Info
Statistics
  • Stars: 145
  • Watchers: 5
  • Forks: 18
  • Open Issues: 18
  • Releases: 14
Topics
compression connections libarchive r
Created almost 9 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
dir <- tempfile()
dir.create(dir)
knitr::opts_knit$set(root.dir = dir)
options(tibble.print_min = 4L)
library(archive)
```
# archive


[![R-CMD-check](https://github.com/r-lib/archive/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/archive/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/r-lib/archive/main)](https://app.codecov.io/github/r-lib/archive?branch=main)
[![CRAN status](https://www.r-pkg.org/badges/version/archive)](https://CRAN.R-project.org/package=archive)


R bindings to libarchive .
Supports many archives formats, including tar, ZIP, 7-zip, RAR, CAB.
Also supports many filters such as gzip, bzip2, compress, lzma, xz and uuencoded files, among others.

archive provides interfaces to read and write connections into archives, as
well as efficiently reading and writing archives directly to disk.

## Installation

You can install archive from CRAN with:

``` r
# install.packages("archive")
```

## Example

### Single file archives

Use `archive_read()` and `archive_write()` to read and write single files to an archive.
These files return connections, which can be passed to any R interface which can take a connection.
Most base R file system functions use connections, as well as some packages like [readr](https://readr.tidyverse.org/).

```{r}
library(readr) # read_csv(), write_csv(), cols()

# Write a single dataset to zip
write_csv(mtcars, archive_write("mtcars.zip", "mtcars.csv"))

# Read the data back, by default the first file is read from the archive.
read_csv(archive_read("mtcars.zip"), col_types = cols())

# Also supports things like archiving and compression together
# Write a single dataset to (gzip compressed) tar
write_csv(mtcars, archive_write("mtcars.tar.gz", "mtcars.csv", options = "compression-level=9"))

# Read the data back
read_csv(archive_read("mtcars.tar.gz"), col_types = cols())

# Archive file sizes
file.size(c("mtcars.zip", "mtcars.tar.gz"))
```

### Multi file archives

`archive_write_files()` is used to create a new archive from multiple files on disk.

```{r}
# Write a few files to the temp directory
write_csv(iris, "iris.csv")
write_csv(mtcars, "mtcars.csv")
write_csv(airquality, "airquality.csv")

# Add them to a new archive
archive_write_files("data.tar.xz", c("iris.csv", "mtcars.csv", "airquality.csv"))

# View archive contents
a <- archive("data.tar.xz")
a

# By default `archive_read()` will read the first file from a multi-file archive.
read_csv(archive_read("data.tar.xz"), col_types = cols())

# Use a number to read a different file
read_csv(archive_read("data.tar.xz", file = 2), col_types = cols())

# Or a filename to read a specific file
read_csv(archive_read("data.tar.xz", file = "mtcars.csv"), col_types = cols())
```

### Regular files (with compression)
`file_write()` returns a connection to filtered by one or more compressions or
encodings. `file_read()` reads a compressed file, automatically detecting the
compression used.

```{r}
# Write bzip2, uuencoded data
write_csv(mtcars, file_write("mtcars.bz2", filter = c("uuencode", "bzip2")))

# Read it back, the formats are automatically detected
read_csv(file_read("mtcars.bz2"), col_types = cols())
```

Owner

  • Name: R infrastructure
  • Login: r-lib
  • Kind: organization

GitHub Events

Total
  • Create event: 3
  • Issues event: 8
  • Release event: 3
  • Watch event: 2
  • Issue comment event: 5
  • Push event: 48
  • Pull request event: 4
  • Fork event: 2
Last Year
  • Create event: 3
  • Issues event: 8
  • Release event: 3
  • Watch event: 2
  • Issue comment event: 5
  • Push event: 48
  • Pull request event: 4
  • Fork event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 393
  • Total Committers: 11
  • Avg Commits per committer: 35.727
  • Development Distribution Score (DDS): 0.29
Past Year
  • Commits: 33
  • Committers: 3
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.061
Top Committers
Name Email Commits
Jim Hester j****r@g****m 279
Gábor Csárdi c****r@g****m 88
cielavenir c****n@g****m 10
Jeroen Ooms j****s@g****m 8
mike m****c@c****m 2
Tomas Kalibera t****a@g****m 1
Sergey Fedorov v****d@g****m 1
Salim B g****b@s****e 1
Aris Paschalidis a****s@g****m 1
Anthony Damico a****o@g****m 1
Allen Luce a****n@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 80
  • Total pull requests: 32
  • Average time to close issues: 9 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 41
  • Total pull request authors: 14
  • Average comments per issue: 1.63
  • Average comments per pull request: 2.16
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 2
  • Average time to close issues: 3 days
  • Average time to close pull requests: about 3 hours
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 0.71
  • Average comments per pull request: 0.5
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • gaborcsardi (15)
  • jimhester (13)
  • coolbutuseless (4)
  • ajdamico (4)
  • bshor (3)
  • pschloss (2)
  • pakom (2)
  • raymondben (2)
  • jennybc (2)
  • T145 (2)
  • GoChartingAdmin (2)
  • noamross (1)
  • cielavenir (1)
  • jeffrosenblum (1)
  • cboettig (1)
Pull Request Authors
  • cielavenir (10)
  • jeroen (6)
  • jimhester (4)
  • gaborcsardi (4)
  • ajdamico (2)
  • allenluce (2)
  • coolbutuseless (2)
  • kalibera (2)
  • salim-b (1)
  • orgadish (1)
  • arisp99 (1)
  • pschloss (1)
  • barracuda156 (1)
  • MichaelChirico (1)
Top Labels
Issue Labels
feature (8) bug (5) up for grabs (2) reprex (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 8,816 last-month
  • Total dependent packages: 7
  • Total dependent repositories: 30
  • Total versions: 16
  • Total maintainers: 1
cran.r-project.org: archive

Multi-Format Archive and Compression Support

  • Versions: 16
  • Dependent Packages: 7
  • Dependent Repositories: 30
  • Downloads: 8,816 Last month
Rankings
Stargazers count: 2.9%
Forks count: 4.8%
Average: 4.9%
Dependent repos count: 5.0%
Downloads: 5.2%
Dependent packages count: 6.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.1.0 depends
  • cli * imports
  • glue * imports
  • rlang * imports
  • tibble * imports
  • covr * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/rhub.yaml actions
  • r-hub/actions/checkout main composite
  • r-hub/actions/platform-info main composite
  • r-hub/actions/run-check main composite
  • r-hub/actions/setup main composite
  • r-hub/actions/setup-deps main composite
  • r-hub/actions/setup-r main composite