Skip to main content

Nintendo parameter archive (AAMP) library

Project description

Nintendo parameter archive (AAMP) library

Everything should work correctly for BotW parameter archives, though this hasn't been tested a lot.

Some more esoteric parameter types are left unsupported currently.

Setup

Install with pip install aamp or on Windows py -m pip install aamp.

Converter usage

aamp_to_yml will convert an AAMP to a human readable representation. yml_to_aamp will do the opposite.

Library usage

To read a parameter archive, create a Reader and give it the binary archive data, then call parse() to get a ParameterIO. This API is purposefully very similar to Nintendo's official parameter utils to help with reverse engineering and re-implementing parts of the game code.

Parameter is a simple value, for example a boolean or an integer.

ParameterObject is a key-value mapping where keys are strings and values are always Parameters.

ParameterList is also a key-value mapping, but it contains objects and other lists rather than Parameters.

ParameterIO is a special ParameterList with some extra attributes, like a version number and a type string (usually xml).

>>> import aamp
>>> reader = aamp.Reader(open('test_data/DamageReactionTable.bxml', 'rb').read())
>>> pio = reader.parse()
>>> pio.list('param_root').list('Basic').object('Edge')
ParameterObject(params={375673178: True, 2982974660: True, 4022901097: True, 2861907126: True, 3947755327: True, 1529444359: False})
>>> pio.list('param_root').list('Basic').object('Edge').param('Damage')
True

ParameterObject:

  • .param(param_name) returns a parameter. KeyError is raised if the parameter doesn't exist.
  • .set_param(param_name, value)

ParameterList:

  • .list(list_name) returns a parameter list. KeyError is raised if the list doesn't exist.
  • .object(object_name) returns a parameter object. KeyError is raised if the object doesn't exist.
  • .set_list(list_name, param_list)
  • .set_object(object_name, param_object)

ParameterIO:

  • Same as ParameterList, but with extra attributes version (usually 0) and type (usually xml).

For writing a binary parameter archive, create a Writer and pass it a ParameterIO, then call write(stream) with a seekable stream.

License

This software is licensed under the terms of the GNU General Public License, version 2 or later.

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 Distribution

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

aamp-1.3.0-py3-none-any.whl (337.2 kB view details)

Uploaded Python 3

File details

Details for the file aamp-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: aamp-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 337.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for aamp-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a026bfa21cc77f1100e538d97b58fecb011f4f8120fc2e5db76f85e0999a935
MD5 549787a467702aaefc22d6ee5b2bdbec
BLAKE2b-256 babefd449c741bda082add5f0a2cca13f0afbb77c4a55f099aeb65bd5388ff76

See more details on using hashes here.

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