Metadata-Version: 2.4
Name: pyuepak
Version: 0.2.6.2
Summary: pyuepak is a Python library for working with Unreal Engine .pak files.
Author-email: stas96111 <stas96111@gmail.com>
License: MIT License
        
        Copyright (c) 2025 stas96111
        
        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.
Project-URL: Homepage, https://github.com/stas96111/pyuepak
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# pyuepak

**pyuepak** is a Python library for working with Unreal Engine `.pak` files.

## Features

- Can read and write `.pak` versions 1–11
- Can read encrypted paks
- Can read Zlib, Oodle compressed paks

## Installation

```bash
pip install pyuepak
```

Or install directly from the repository:

```bash
git clone https://github.com/stas96111/pyuepak.git
cd pyuepak
pip install -r requirements.txt
pip install .
```

## CLT

```bash
pyuepak [OPTIONS] COMMAND [ARGS]...
```

Global option:
`--aes <key>` — AES key for encrypted `.pak` files.

---

## Commands

| Command   | Description                     |
| --------- | ------------------------------- |
| `info`    | Show info about a `.pak` file   |
| `list`    | List all files in the archive   |
| `extract` | Extract one file                |
| `unpack`  | Unpack all files                |
| `pack`    | Pack a folder into `.pak`       |
| `read`    | Read a file and print to stdout |

---

## Examples

```bash
pyuepak info -p game.pak
pyuepak unpack -p game.pak -o out/
pyuepak extract -p game.pak -f "Game/Content/file.txt"
pyuepak pack -i folder -o new.pak
```

Encrypted file:

```bash
pyuepak --aes 1234567890ABCDEF info -p encrypted.pak
```

## Usage

```python
from pyuepak import PakFile, PakVersion

pak = PakFile()
pak.read(r"path/to/pak.pak")

print(pak.list_files()) # ["/Game/asset.uasset", ...]
print(pak.mout_point) # "../../../" (default)
print(pak.key) # b'0000000...' AES key (default)
print(pak.path_hash_seed) # 0 (default)
print(pak.count) # prints file count

data = pak.read_file(r"/Game/asset.uasset") # return binary data
pak.remove_file(r"/Game/asset.uasset")

new_pak = PakFile()
new_pak.add_file("/Game/asset.uasset", data)
new_pak.set_version(PakVersion.V11)
new_pak.set_mount_point("../../..")

new_pak.write(r"path/to/pak.pak")

```

## Contributing

Contributions are welcome! Please open issues or submit pull requests.

## Credits
This project is based on information and ideas from two great open-source tools: 
 - [repak](https://github.com/trumank/repak)
 - [rust-u4pak](https://github.com/panzi/rust-u4pak).

## License

This project is licensed under the MIT License.
