Skip to main content

unity3d compatible lz4 (un)compress tool working on Python3.

Project description

Copyright (c) 2017 CrescentApricot

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description: # lz4unipy

## 概要

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

## インストール

```bash
pip3 install lz4unipy
```

## 使い方

### コマンドライン

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

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

### ライブラリ

```python
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))
```

## テスト

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

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

Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: System :: Archiving :: Compression
Classifier: Topic :: Software Development :: Libraries :: Python Modules

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lz4unipy-2.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

lz4unipy-2.0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file lz4unipy-2.0.1.tar.gz.

File metadata

  • Download URL: lz4unipy-2.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.1

File hashes

Hashes for lz4unipy-2.0.1.tar.gz
Algorithm Hash digest
SHA256 b2768a2eba7fd20b9ca051d1baf6594d22fcfb2610e5d385bc69e94c99be9724
MD5 b7b9f7bcde3f9b558e9f7a4d43e919c0
BLAKE2b-256 f8658c9a612edf9d0dcd478f19ca844fa9babd6a1cee05a5aac2bd2ea3964d35

See more details on using hashes here.

File details

Details for the file lz4unipy-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: lz4unipy-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.1

File hashes

Hashes for lz4unipy-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e70e1b5ff3dd727beeefbdd74a2c66b2896ccb9e4d442205d252a87de3aee8ea
MD5 1878b890a7c0adcb837fcba0d4194cdc
BLAKE2b-256 9187fca5639998f47484d77ba81dc79bb8124305b0e5c3ebc6d4853996e80a7d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page