Metadata-Version: 2.4
Name: dvpl-converter
Version: 0.1.1
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Rust
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: System :: Archiving :: Compression
Requires-Dist: mypy>=1.20.1 ; extra == 'dev'
Requires-Dist: ruff>=0.15.10 ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: Convert DVPL files (World of Tanks Blitz), written in Rust.
Keywords: dvpl,wotb,lz4,compression,world-of-tanks
Home-Page: https://github.com/MihaiStreames/dvpl-converter
Author-email: MihaiStreames <72852703+MihaiStreames@users.noreply.github.com>
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Repository, https://github.com/MihaiStreames/dvpl-converter

<a id="readme-top"></a>

<!-- PROJECT SHIELDS -->

<div align="center">

[![Stars](https://img.shields.io/github/stars/MihaiStreames/dvpl-converter?style=social)](https://github.com/MihaiStreames/dvpl-converter/stargazers)
[![crates.io](https://img.shields.io/crates/v/dvpl-engine.svg)](https://crates.io/crates/dvpl-engine)
[![PyPI](https://img.shields.io/pypi/v/dvpl-converter.svg)](https://pypi.org/project/dvpl-converter)
[![License](https://img.shields.io/github/license/MihaiStreames/dvpl-converter?label=License)](LICENSE)

</div>

<!-- PROJECT LOGO -->

<div align="center">

  <h1>dvpl-converter</h1>

  <h3 align="center">Convert DVPL files (World of Tanks Blitz)</h3>

  <p align="center">
    Encode and decode DVPL-compressed game assets with LZ4/LZ4-HC support, written in Rust.
  </p>
</div>

<!-- TABLE OF CONTENTS -->

<details>
  <summary>Table of Contents</summary>
  <ol>
    <li><a href="#about-the-project">About The Project</a></li>
    <li>
      <a href="#getting-started">Getting Started</a>
      <ul>
        <li><a href="#python-pypi">Python (PyPI)</a></li>
        <li><a href="#rust-cratesio">Rust (crates.io)</a></li>
      </ul>
    </li>
    <li><a href="#usage">Usage</a></li>
    <li><a href="#dvpl-format">DVPL Format</a></li>
    <li><a href="#license">License</a></li>
  </ol>
</details>

<!-- ABOUT THE PROJECT -->

## About The Project

DVPL is a compression format used by World of Tanks Blitz for game assets. This tool decodes DVPL files to their original form and encodes files back to DVPL with configurable compression (none, LZ4, or LZ4-HC).

- Decode `.dvpl` files back to their original format
- Encode files to DVPL with LZ4 or LZ4-HC compression
- Batch convert multiple files at once
- CRC32 integrity verification on decode
- Native Rust engine with Python CLI

<p align="right">(<a href="#readme-top">back to top</a>)</p>

### Built With

- [Rust](https://www.rust-lang.org/) + [PyO3](https://pyo3.rs/) + [maturin](https://github.com/PyO3/maturin)
- [lz4](https://crates.io/crates/lz4) (C bindings for LZ4/LZ4-HC)
- [crc32fast](https://crates.io/crates/crc32fast) (hardware-accelerated CRC32)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- GETTING STARTED -->

## Getting Started

### Python (PyPI)

```bash
pip install dvpl-converter
```

### Rust (crates.io)

```bash
cargo add dvpl-engine
```

```rust
use dvpl_engine::decode;
use dvpl_engine::encode;
use dvpl_engine::COMP_LZ4_HC;

let original = b"Hello DVPL!";
let dvpl_blob = encode(original, COMP_LZ4_HC).unwrap();
let decoded = decode(&dvpl_blob).unwrap();
assert_eq!(original.as_slice(), &decoded);
```

### Development

```bash
git clone https://github.com/MihaiStreames/dvpl-converter.git
cd dvpl-converter
maturin develop --release
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- USAGE -->

## Usage

```bash
# decode DVPL files (default)
dvpl-converter file.xml.dvpl

# encode files to DVPL
dvpl-converter -e file.xml

# batch convert
dvpl-converter *.dvpl

# custom output directory
dvpl-converter -o output/ file.xml.dvpl
```

### All the Flags

| Flag | Short | What it does |
| ---- | ----- | ------------ |
| `--encode` | `-e` | Encode to DVPL (default is decode) |
| `--compression` | `-c` | Compression type: 0=none, 1=lz4, 2=lz4-hc (default: 2) |
| `--output-dir` | `-o` | Output directory |

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- DVPL FORMAT -->

## DVPL Format

A `.dvpl` file is a payload followed by a 20-byte footer:

| Field             | Size    | Encoding       |
|-------------------|---------|----------------|
| `original_size`   | 4 bytes | little-endian  |
| `compressed_size` | 4 bytes | little-endian  |
| `crc32`           | 4 bytes | little-endian  |
| `compression`     | 4 bytes | little-endian  |
| `magic`           | 4 bytes | `DVPL`         |

Compression types: `0` = none, `1` = LZ4, `2` = LZ4-HC.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- LICENSE -->

## License

MIT. Do whatever you want with it. See [LICENSE](LICENSE) for details.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

---

<div align="center">

Made with ❤️

</div>

