Skip to main content

No project description provided

Project description

autoangel

Python bindings for parsing and manipulating Angelica Engine game files.

Installation

pip install autoangel

Quick Start

Working with elements.data

import autoangel

# Load elements.data file
data = autoangel.read_elements('/path/to/elements.data')

# Inspect data
print(f'Version: {data.version}')
print(f'Number of lists: {len(data)}')

# Access a specific list (e.g., weapons list)
weapons_list = data[3]
print(f'List: {weapons_list.config.caption}')

# Iterate through entries
for i in range(10):
    weapon = weapons_list[i]
    print(f'ID: {weapon.ID}, name: {weapon.Name}')

# Modify entries
for weapon in weapons_list:
    weapon.durability_min = weapon.durability_max = 99999

# Save modifications
data.save('modified_elements.data')

Working with pck/pkx files

import autoangel

# Load package
package = autoangel.read_pck('/path/to/package.pck')

# Or load a paired pck+pkx package
package = autoangel.read_pck('/path/to/package.pck', '/path/to/package.pkx')

# List all files in the package
files = package.file_list()
print(f'Number of files: {len(files)}')

# Find files with a specific prefix
textures = package.find_prefix('textures/')
print(f'Number of texture files: {len(textures)}')

# Extract a specific file
file_content = package.get_file('some/path/in/package.txt')
if file_content:
    with open('extracted_file.txt', 'wb') as f:
        f.write(file_content)

Creating and modifying pck packages

from pathlib import Path
import autoangel

# Create a package from scratch
builder = autoangel.PackageBuilder()
builder.add_file('models/npc.ecm', Path('npc.ecm').read_bytes())
builder.add_file('models/player.ecm', Path('player.ecm').read_bytes())
builder.save('models.pck')

# Modify an existing package
package = autoangel.read_pck('/path/to/textures.pck')
builder = package.to_builder()
builder.add_file('textures/new_texture.dds', new_texture_data)
builder.remove_file('textures/old_texture.dds')
builder.save('textures_modified.pck')

# Serialize to bytes instead of file
raw = builder.to_bytes()

API Reference

Functions

Function Description
read_elements(path, config?) Parse elements.data from file (memory-mapped)
read_elements_bytes(content, config?) Parse elements.data from bytes
read_elements_config(path) Parse elements config from file
read_elements_config_string(content) Parse elements config from string
read_pck(path, pkx_path?, config?) Parse pck package from file (memory-mapped)
read_pck_bytes(content, config?) Parse pck package from bytes

Classes

ElementsData, ElementsDataList, ElementsDataEntry, ElementsConfig, ElementsListConfig, PackageConfig, PckPackage, PackageBuilder

Full type stubs are included with the package. See autoangel.pyi for details.

API documentation is available on GitHub Pages.

Key Details

  • File-backed parsing uses memory-mapped I/O — source files cannot be modified while ElementsData / PckPackage objects are alive
  • Byte array parsing available via read_elements_bytes() / read_pck_bytes() when mmap is not desired
  • Bundled configs auto-detect game version from the data header; pass your own ElementsConfig to override
  • Entry fields support both attribute-style (entry.Name) and dict-style (entry['Name']) access
  • Modify fields in-place, then call data.save(path) or data.save_bytes() to serialize

Development

Requires uv and a Rust toolchain.

# Build (dev)
uv run maturin develop

# Build (release)
uv run maturin build --release

# Run tests (Python 3.10+ required)
uv run pytest

# Run stubtest
uv run --with mypy python -m mypy.stubtest autoangel --ignore-missing-stub --allowlist stubtest_allowlist.txt

Test data uses Git LFS — run git lfs pull if tests fail on missing files.

License

MIT License

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

autoangel-0.13.0-cp37-abi3-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.7+Windows x86-64

autoangel-0.13.0-cp37-abi3-win32.whl (3.7 MB view details)

Uploaded CPython 3.7+Windows x86

autoangel-0.13.0-cp37-abi3-manylinux_2_34_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.34+ x86-64

autoangel-0.13.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (7.9 MB view details)

Uploaded CPython 3.7+macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

File details

Details for the file autoangel-0.13.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: autoangel-0.13.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for autoangel-0.13.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 75d1d324c2ed07a2b5bb8e1ba6cb53a4c6785296cb21941e59a2bd26cd48e8e7
MD5 94b963ce452ad5ffff52db6e48b1c429
BLAKE2b-256 5d5a6a0dd69b6d2f3636d475b4ad66ada9b2e51c5f19927051d1e6ba748a62a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoangel-0.13.0-cp37-abi3-win_amd64.whl:

Publisher: publish.yml on Smertig/autoangel-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autoangel-0.13.0-cp37-abi3-win32.whl.

File metadata

  • Download URL: autoangel-0.13.0-cp37-abi3-win32.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for autoangel-0.13.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 36761425da8044ae3ffd179222e3181165f5a20db0c9512ad649aa3465b4599c
MD5 4f4acf493e2e8d1b3638ee7e16a754ea
BLAKE2b-256 41e00708ff20eaaafc3e7ccf99b793146036c4ff33d75ad27a23307737b08803

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoangel-0.13.0-cp37-abi3-win32.whl:

Publisher: publish.yml on Smertig/autoangel-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autoangel-0.13.0-cp37-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for autoangel-0.13.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fb9c0b0e03196d8e2334c3b9d6abe7313796d007019d06cb191cde840b048367
MD5 d3ea0f1cba6391140c7c7195206c97ea
BLAKE2b-256 2a7c96a2b7b726106f3f591b803e8922922b77eb295b336668e7c7c5d70361ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoangel-0.13.0-cp37-abi3-manylinux_2_34_x86_64.whl:

Publisher: publish.yml on Smertig/autoangel-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autoangel-0.13.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for autoangel-0.13.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c65ac2d74647c8267e42a8195a962e78b2f3758876a0b80a487d6dd435e3e398
MD5 d0ea314267f5e7a7220a335946dbf285
BLAKE2b-256 889abe4875889c2976c094f12040942301a835743d13293adecd35b8f05d677f

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoangel-0.13.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl:

Publisher: publish.yml on Smertig/autoangel-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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