{"library":"fastar","title":"fastar","description":"The fastar library provides high-level Python bindings for the Rust `tar`, `flate2`, and `zstd` crates, offering a high-performance solution for working with compressed and uncompressed tar archives. It is currently at version 0.9.0 and has a consistent release cadence, with updates addressing features and underlying Rust library versions.","status":"active","version":"0.9.0","language":"en","source_language":"en","source_url":"https://github.com/DoctorJohn/fastar","tags":["tar","archive","compression","rust","high-performance","bindings"],"install":[{"cmd":"pip install fastar","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"The primary way to interact with the library is through the top-level 'fastar' module.","symbol":"fastar","correct":"import fastar"}],"quickstart":{"code":"from pathlib import Path\nimport fastar\nimport os\n\n# Create a dummy file\ninput_file = Path(\"file.txt\")\ninput_file.write_text(\"Hello, Fastar!\")\n\n# Create a tar archive (uncompressed)\nwith fastar.open(\"archive.tar\", \"w\") as archive:\n    archive.append(input_file)\n\n# Extract the tar archive\noutput_dir = Path(\"output\")\noutput_dir.mkdir(exist_ok=True)\nwith fastar.open(\"archive.tar\", \"r\") as archive:\n    archive.unpack(output_dir)\n\nunpacked_file = output_dir / \"file.txt\"\nprint(f\"Unpacked file content: {unpacked_file.read_text()}\")\n\n# Clean up (optional)\ninput_file.unlink()\nPath(\"archive.tar\").unlink()\noutput_dir.rmdir()","lang":"python","description":"This quickstart demonstrates how to create a simple text file, add it to an uncompressed tar archive using `fastar.open` in write mode, and then extract its contents using read mode. It highlights the basic `append` and `unpack` operations."},"warnings":[{"fix":"Upgrade to fastar version 0.9.0 or later to ensure these security fixes are applied: `pip install --upgrade fastar`.","message":"Versions prior to 0.9.0 may contain security vulnerabilities (CVE-2026-32766 and CVE-2026-33056) inherited from underlying Rust crates like `rust-tar`.","severity":"breaking","affected_versions":"<0.9.0"},{"fix":"Always explicitly specify the compression mode (e.g., 'w:gz' for gzip, 'w:zst' for Zstandard) when creating compressed archives, or use 'r' for automatic detection when reading.","message":"The `fastar.open` method supports various modes for compression (`w`, `w:gz`, `w:zst`, `r`, `r:`, `r:gz`, `r:zst`). Using the wrong mode for a compressed archive can lead to errors or corrupted data.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}