Skip to content

CrescentApricot/lz4unipy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lz4unipy

概要

lz4unipyunity-lz4 互換の展開/圧縮を行うコマンドラインツールと簡易なライブラリです。

インストール

pip3 install lz4unipy

使い方

コマンドライン

lz4unipy [-h] [--dir DIR] infile [infile ...]

指定したファイルより自動的に動作モードを、パスより自動的に出力ファイル名を決定します。

ライブラリ

import lz4unipy

with open("target_file.unity3d.lz4", "rb") as f:
    data = f.read()
    if lz4unipy.is_compressed(data):
        with open("target_file.unity3d", "wb") as w:
            w.write(lz4unipy.decompress(data))

with open("target_file.unity3d", "rb") as f:
    data = f.read()
    if not lz4unipy.is_compressed(data):
        with open("target_file.unity3d.lz4", "wb") as w:
            w.write(lz4unipy.compress(data))

テスト

git clone git@github.com/CrescentApricot/lz4unipy.git
cd lz4unipy
python3 setup.py test

謝辞

テスト用ファイル sample.png にはバンダイナムコエンターテインメント株式会社の提供するスマートフォン向けリズムゲーム、アイドルマスターミリオンライブ! シアターデイズのゲーム内スクリーンショットを利用しています。この場を借りてお礼申し上げます。