Metadata-Version: 2.4
Name: lodfile
Version: 0.1.4
Summary: Read and write Heroes of Might and Magic III .lod archives with a zipfile-like API
Keywords: lod,homm3,hota,heroes3,archive
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: core

# lodfile

Read and write Heroes of Might and Magic III (incl. HotA) `.lod` archives, such as
`H3Bitmap.lod`, with an API modelled on `zipfile` / `tarfile`.

## Install

```bash
pip install lodfile[core]
```

The core is pure standard library, no dependencies.

## Usage

```python
import lodfile

with lodfile.LodFile("H3Bitmap.lod") as lod:
    print(lod.namelist())
    data = lod.read("Adventure.def")
    lod.extract("Adventure.def", "out/")
    lod.extractall("out/")

# Create / append
with lodfile.LodFile("my.lod", "w") as lod:
    lod.write("hero.pcx")
    lod.writestr("notes.txt", "hello")

with lodfile.LodFile("my.lod", "a") as lod:
    lod.write("extra.pcx")
```

CLI:

```bash
lodfile list H3Bitmap.lod
lodfile extract H3Bitmap.lod -d out/
lodfile create my.lod a.pcx b.pcx
```

## Format

Little endian. 92-byte header (`LOD\0`, type, entry count, 80 bytes padding), then
32-byte entries (16-byte name, offset, size, type, compressed size), then data.
Compressed entries are zlib streams (compressed size `0` means stored raw).
Names are case-insensitive and limited to 16 bytes.
