Crates.io | rpgcpf |
lib.rs | rpgcpf |
version | 0.1.1 |
created_at | 2025-03-26 03:45:29.56949+00 |
updated_at | 2025-03-26 21:44:33.745656+00 |
description | GCPF archive compression and decompression library |
homepage | |
repository | https://git.sr.ht/~absolutely-vivid/rpgcpf |
max_upload_size | |
id | 1606119 |
size | 75,802 |
⚠️ this is alpha quality software! there may be some unknown bugs! ⚠️
rpgcpf is a rust library and command line tool for compressing and decompressing godot compressed packed format (GCPF) files.
This repository contains a rust library and a command line application.
The rpgcpf
cli tool decompresses GCPF files, and compresses uncompressed files to the GCPF format.
Usage: rpgcpf <COMMAND>
Commands:
pack Compress an input to an output
unpack Decompress an input to an output
info Show info and statistics about an input
help Print this message or the help of the given subcommand(s)
Options:
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
for now rpgcpf is only available through cargo, but there are plans to package it for distribution through other package managers when it's more stable.
cargo install rpgcpf
rpgcpf
is a rust library implementing GCPF compression in decompression. It supports the brotli, deflate, fastlz, gzip, and zstd compression modes.
You can read the crate documentation at https://docs.rs/rpgcpf/latest/rpgcpf/
Decompression example:
use rpgcpf::Gcpf;
let data: &[u8] = /* ... */;
let mut uncompressed = Gcpf::read(data)
.unwrap()
.decompress()
.unwrap()
Compression example:
use rpgcpf::{CompressionMode, Gcpf};
let data: &[u8] = /* ... */;
let mut compressed = Gcpf::compress(data, CompressionMode::Zstd).unwrap();
rpgcpf is available on crates.io
cargo add rpgcpf
rpgcpf uses cargo features to enable or disable compression modes at compile time. these features are:
brotli
: enables the brotli comression mode, depends on the brotli
cratedeflate
: enables the deflate comression mode, depends on the flate2
cratefastlz
: enables the fastlz comression mode, depends on the fastlz-rs
crategzip
: enables the gzip comression mode, depends on the flate2
cratezstd
: enables the zstd comression mode, depends on the zstd
cratecli
: enables the command line binary, and adds clap
derives to the Gcpf
struct. Depends on the clap
, patharg
, anyhow
, and humanize-bytes
cratesthe default
features are: ["brotli", deflate", "fastlz", "gzip", "zstd", "cli"]
TODO
This work is marked with CC0 1.0. Read the LICENSE file for details.
Thanks for not using this code to train an LLM or machine learning model :)