Skip to content

Ravencentric/archivefile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Apr 27, 2024
27d061a · Apr 27, 2024

History

1 Commit
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024

Repository files navigation


Logo

Unified interface for tar, zip, sevenzip, and rar files

PyPI - Version PyPI - Python Version License Checked with mypy Ruff

GitHub Workflow Status (with event) GitHub Actions Workflow Status codecov

Table Of Contents

About

archivefile is a wrapper around tarfile, zipfile, py7zr, and rarfile. It simplifies archive management tasks by providing a unified interface.

Installation

archivefile is available on PyPI, so you can simply use pip to install it.

pip install archivefile

Usage

from archivefile import ArchiveFile

with ArchiveFile("archive.tar", "w") as archive:
    archive.extract("member.txt") # Extract a single member of the archive

with ArchiveFile("archive.tar", "w") as archive:
    archive.extractall(destination="~/output") # Extract all members

with ArchiveFile("archive.tar") as archive:
    archive.read_text("member.txt") # Read a member of the archive