https://github.com/roquess/paxit
Paxit is a flexible Rust library for compressing and decompressing files using various algorithms, with a modular design that allows easy addition of new compression formats.
https://github.com/roquess/paxit
Last synced: 3 months ago
JSON representation
Paxit is a flexible Rust library for compressing and decompressing files using various algorithms, with a modular design that allows easy addition of new compression formats.
- Host: GitHub
- URL: https://github.com/roquess/paxit
- Owner: roquess
- License: mit
- Created: 2025-01-02T06:07:27.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-19T12:28:26.000Z (9 months ago)
- Last Synced: 2025-06-05T08:25:44.954Z (4 months ago)
- Language: Rust
- Size: 3.84 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust - paxit - Flexible library for compressing and decompressing files using various algorithms (zip, tar, gzip, xz, zst, etc.) with modular design for easy extension (Libraries / Compression)
- fucking-awesome-rust - paxit - Flexible library for compressing and decompressing files using various algorithms (zip, tar, gzip, xz, zst, etc.) with modular design for easy extension (Libraries / Compression)
README
# Paxit
Paxit is a flexible Rust library for compressing and decompressing files using various algorithms, with a modular design that allows easy addition of new compression formats.
## Features
- Supports multiple compression formats: "bmp", "dds", "farbfeld", "gif", "hdr", "ico", "jpg", "jpeg", "xz", "gz", "png", "pbm", "pgm", "ppm", "tar", "tga", "tiff", "tif", "webp", "zip", "zst".
- Modular design for easy addition of new compression algorithms.
- Simple command-line interface for compressing and decompressing files.## Installation
To use Paxit, add the following to your `Cargo.toml`:
```toml
[dependencies]
paxit = "0.1.4"
```## Usage
Command-Line Interface
Paxit provides a simple command-line interface for compressing and decompressing files.### Compression
To compress files, use the following command:
```bash
paxit compress
```For example, to compress file1.txt and file2.txt into archive.zip:
```bash
paxit compress archive.zip file1.txt file2.txt
```### Decompression
To decompress a file, use the following command:
```bash
paxit uncompress
```For example, to decompress archive.zip into the output directory:
```bash
paxit uncompress archive.zip output
```## Library Usage
You can also use Paxit as a library in your Rust projects. Here is an example of how to use it:
```rust
use paxit::algorithms::{Zip, Tar, Gunzip};
use paxit::pack::Pack;
use std::path::Path;fn main() {
let files = vec![Path::new("file1.txt"), Path::new("file2.txt")];
let output = Path::new("archive.zip");let compressor = Zip;
compressor.pack(files, output).unwrap();
}
```## Adding New Compression Algorithms
To add a new compression algorithm, simply create a new file in the algorithms directory and implement the Pack trait. The library will automatically detect and use the new algorithm.
# Contributing
Contributions are welcome! Please open an issue or submit a pull request.
You can update the mod.rs file by running :
```bash
cargo r --bin gen_mod
```# License
This project is licensed under the MIT License.