Infrastructure as Code

Repositories with services as code

fastar (0.12.0)

Published 2026-09-17 00:06:35 +03:00 by mpavlov

Installation

pip install --index-url https://olssonul.com/api/packages/iac/pypi/simple/ --extra-index-url https://pypi.org/simple fastar

About this package

High-level bindings for the Rust tar crate

Fastar

Versions PyPI Downloads License CodSpeed

The fastar library wraps the Rust tar, flate2, and zstd crates, providing a high-performance way to work with compressed and uncompressed tar archives in Python.

Installation

pip install fastar

Usage

This section shows basic examples of how to create and extract tar archives using Fastar. For more usage examples, please refer directly to the test cases in the tests directory.

import fastar
from pathlib import Path


input_file = Path("file.txt")
input_file.write_text("Hello, Fastar!")


with fastar.open("archive.tar", "w") as archive:
    archive.append(input_file)


with fastar.open("archive.tar", "r") as archive:
    archive.unpack("output/")


unpacked_file = Path("output/file.txt")
print(unpacked_file.read_text())  # Hello, Fastar!

Opening Modes

The fastar.open method supports the following modes:

Mode Action Compression
"w" Write None
"w:gz" Write Gzip
"w:zst" Write Zstandard
"r" Read Automatically detected
"r:" Read None
"r:gz" Read Gzip
"r:zst" Read Zstandard

Development

  1. Install dependencies into a virtual env: uv sync
  2. Make changes to the code and tests
  3. Build the package: uv run maturin develop
  4. Run the tests: uv run pytest

Requirements

Requires Python: >=3.8
Details
PyPI
2026-09-17 00:06:35 +03:00
26
996 KiB
Assets (1)
Versions (1) View all
0.12.0 2026-09-17