Skip to main content

A simple Nintendo BYML or BYAML v2/v3 parser and writer

Project description

Simple bymlv2 parser + writer + converters

Features:

  • Supports v2 and v3 files. These versions are respectively used by The Legend of Zelda: Breath of the Wild and Super Mario Odyssey.
  • Supports 64-bit node types which are used in Super Mario Odyssey.
  • Supports both endianness. The little-endian format is used on the Switch.
  • Cross platform.
  • Easy to edit and readable output. No ugly XML. Unobtrusive type information.

Quick usage

byml_to_yml   PATH_TO_BYML
yml_to_byml   PATH_TO_YAML

Output will be sent to stdout and can be piped into a file. Pass - as the path to read from stdin.

Library

import byml

parser = byml.Byml(raw_bytes)
document = parser.parse()

writer = byml.Writer(document, be=big_endian_mode, version=byml_version)
writer.write(writable_seekable_stream)

Note about YAML integers/floats

The initial version of this library supported automatic type detection.

However, the problem with automatic type detection is that Nintendo sometimes uses signed integers even when it makes no sense and their byml library will only look for int nodes. Other times they will use uints for the same data type (crc32 hashes).

It's totally unpredictable.

So we need to keep type information when dumping/loading files instead of guessing types.

To keep YAML output easy to read and write, the converter scripts will use prefixes to indicate types for literals:

  • Unsigned integers will get a 'u' prefix.
  • 64 bit types will additionally get a 'l'.

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 Distribution

byml-2.0.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

byml-2.0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file byml-2.0.1.tar.gz.

File metadata

  • Download URL: byml-2.0.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for byml-2.0.1.tar.gz
Algorithm Hash digest
SHA256 e3d83d33bb22d853b929dad203ca84237f967284a443ee60dfdb65e6f5554669
MD5 d31c224ca71862e3d7529fb4dfc024f2
BLAKE2b-256 015371f3d9f1baed0bb6245ac6f6c7cf2dbc4ca11dea456df0a259352c3be691

See more details on using hashes here.

File details

Details for the file byml-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: byml-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6

File hashes

Hashes for byml-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 531a02a24c09c718c41d3f4f553c4d214cd1c3eedbee253f5f726b85affb7dc2
MD5 c9a9454a9d3304e66cdd3573f1c70543
BLAKE2b-256 a15d45b6c19bb08af1cab182c12c58b3aeb3f5ff1dec55eff37c62194d83a9b0

See more details on using hashes here.

Supported by

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