Skip to main content

Re-implementation of genieutils in Python

Project description

genieutils-py

Python implementation of genieutils.

This library can be used to read and write empires2_x2_p1.dat files for Age of Empires II Definitive Edition.

Supported dat versions

Currently, only the recent versions used in Age of Empires II Definitive Edition are supported (GV_C20 and above, corresponding to FileVersion 7.7 and above).

Installation

pip install genieutils-py

Usage examples

Dump the whole dat file as json

The package comes with a handy command line tool that does that for you.

dat-to-json path/to/empires2_x2_p1.dat

Change cost of Loom to 69 Gold

from genieutils.datfile import DatFile

data = DatFile.parse('path/to/empires2_x2_p1.dat')
data.techs[22].resource_costs[0].amount = 69
data.save('path/to/modded/empires2_x2_p1.dat')

Prevent Kings from garrisoning

from genieutils.datfile import DatFile

data = DatFile.parse('path/to/empires2_x2_p1.dat')
for civ in data.civs:
    civ.units[434].bird.tasks.pop()
data.save('path/to/modded/empires2_x2_p1.dat')

Running tests

Before running tests, you need to add sample empires2_x2_p1.dat files into the tests/testdata subfolder.

  1. Create a virtual environment
    python3 -m venv venv
  2. Activate the virtual environment
    source venv/bin/activate
  3. Install the dev dependencies
    pip install -r requirements-dev.txt
  4. Install the local checkout of genieutils-py in editable mode pip install -e .
  5. Run the test script ./test

Authors

HSZemi - Original Author

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

genieutils_py-0.1.1.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

genieutils_py-0.1.1-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file genieutils_py-0.1.1.tar.gz.

File metadata

  • Download URL: genieutils_py-0.1.1.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for genieutils_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 22a2e6f9f61f153b5ff79a2531a51e6ff49ae26f59c385e6bbee6e991555c9fd
MD5 d0367c80e9a21c1150ce7ded1c58e830
BLAKE2b-256 63069e685af884ddf13b6533ad479a3d6fa6ffb8ae994bf844494cdbb91e5f40

See more details on using hashes here.

Provenance

The following attestation bundles were made for genieutils_py-0.1.1.tar.gz:

Publisher: python-lib.yml on SiegeEngineers/genieutils-py

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

File details

Details for the file genieutils_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: genieutils_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for genieutils_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dce19829d793e180556ea4b0b075e1097c5f3f22d14f959d46dbe4daf172a402
MD5 3392035b31e211233d49b136aa06faad
BLAKE2b-256 d89e662cda60032057941592b504a2fc10725a807a4f4ab0d6c56a991f7b1f1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for genieutils_py-0.1.1-py3-none-any.whl:

Publisher: python-lib.yml on SiegeEngineers/genieutils-py

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