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.
- Create a virtual environment
python3 -m venv venv - Activate the virtual environment
source venv/bin/activate - Install the dev dependencies
pip install -r requirements-dev.txt - Install the local checkout of genieutils-py in editable mode
pip install -e . - Run the test script
./test
Authors
HSZemi - Original Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genieutils_py-0.0.7.tar.gz.
File metadata
- Download URL: genieutils_py-0.0.7.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfad7d97b982b5b9b1f15b709e8d3a2364d4477e250b9a96488206371c19fe4b
|
|
| MD5 |
8142942805b323bd85bde7ac1408eeaa
|
|
| BLAKE2b-256 |
3dada2e482da165826ae07c25995ec8f55eef15feb029d0c457405773091b4e7
|
Provenance
The following attestation bundles were made for genieutils_py-0.0.7.tar.gz:
Publisher:
python-lib.yml on SiegeEngineers/genieutils-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genieutils_py-0.0.7.tar.gz -
Subject digest:
bfad7d97b982b5b9b1f15b709e8d3a2364d4477e250b9a96488206371c19fe4b - Sigstore transparency entry: 188922537
- Sigstore integration time:
-
Permalink:
SiegeEngineers/genieutils-py@db81f7b24a81bf0066cf0f8d7c8cb236a6899179 -
Branch / Tag:
refs/tags/release/0.0.7 - Owner: https://github.com/SiegeEngineers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-lib.yml@db81f7b24a81bf0066cf0f8d7c8cb236a6899179 -
Trigger Event:
push
-
Statement type:
File details
Details for the file genieutils_py-0.0.7-py3-none-any.whl.
File metadata
- Download URL: genieutils_py-0.0.7-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5c4ad5cedec3133df139a84520e8bb7f22b640aa9a6498e96e85b0b4a74c2c9
|
|
| MD5 |
82ed89ae9fc5349e3a6052be17d54eb9
|
|
| BLAKE2b-256 |
38ac00ce0892b8b3c8c67427c9851770f877112d4a3da43771e099e9a92fc1b9
|
Provenance
The following attestation bundles were made for genieutils_py-0.0.7-py3-none-any.whl:
Publisher:
python-lib.yml on SiegeEngineers/genieutils-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
genieutils_py-0.0.7-py3-none-any.whl -
Subject digest:
c5c4ad5cedec3133df139a84520e8bb7f22b640aa9a6498e96e85b0b4a74c2c9 - Sigstore transparency entry: 188922543
- Sigstore integration time:
-
Permalink:
SiegeEngineers/genieutils-py@db81f7b24a81bf0066cf0f8d7c8cb236a6899179 -
Branch / Tag:
refs/tags/release/0.0.7 - Owner: https://github.com/SiegeEngineers
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-lib.yml@db81f7b24a81bf0066cf0f8d7c8cb236a6899179 -
Trigger Event:
push
-
Statement type: