Skip to main content

ssbh_data_py PyPI

Python bindings to the ssbh_data Rust library. ssbh_data_py provides a higher level abstraction over the binary data stored in SSBH files such as a "model.numshb". SSBH files can be created from scratch or modified from existing files entirely in Python.

Report bugs and request new features in issues. Check the requirements before reporting on any installation issues.

Supported Formats

Format Supported Versions (major.minor) Read Save
Modl (.numdlb, .nusrcmdlb) 1.7 :heavy_check_mark: :heavy_check_mark:
Mesh (.numshb) 1.8, 1.9, 1.10 :heavy_check_mark: :heavy_check_mark:
Skel (.nusktb) 1.0 :heavy_check_mark: :heavy_check_mark:
Anim (.nuanmb) 2.0, 2.1 :heavy_check_mark: :heavy_check_mark: (2.0 only)
Matl (.numatb) 1.5, 1.6 :heavy_check_mark: :heavy_check_mark:
Hlpb (.nuhlpb) 1.1 :heavy_check_mark: :heavy_check_mark:
Adj (.adjb) :heavy_check_mark: :heavy_check_mark:
MeshEx (.numshexb) :heavy_check_mark: :heavy_check_mark:

Installing

The package can be installed for a supported python version using pip on the latest version of Windows, Linux, or MacOS. The prebuilt wheels (.whl files) are included only for situations where pip might not be available such as for plugin development for applications.

Installing: pip install ssbh_data_py
Updating: pip install ssbh_data_py --upgrade

The minimum supported pip version is 20.3.

Requirements

The package is available on PyPi for Python 3.9, 3.10, 3.11, 3.12, and 3.13 for newer versions of Windows, Linux, and Mac OS. For other Python versions, build ssbh_data_py from source. ssbh_data_py requires the numpy package for transforms and attribute data.

Getting Started

Each supported SSBH type has an associated data struct that can be created reading from a file.

import ssbh_data_py

mesh = ssbh_data_py.mesh_data.read_mesh("model.numshb")
modl = ssbh_data_py.modl_data.read_modl("model.numdlb")
skel = ssbh_data_py.skel_data.read_skel("model.nusktb")

It's also possible to construct new objects. Specify the major and minor version to use a particular file format revision. Note that this only impacts the binary output when calling the save method. Not all versions are supported, so it's recommended to use the default values.

mesh = ssbh_data_py.mesh_data.MeshData(major_version=1, minor_version=8)
modl = ssbh_data_py.modl_data.ModlData()
skel = ssbh_data_py.skel_data.SkelData()

ssbh_data_py uses standard Python types whenever possible. Conversion to the appropriate binary format is handled automatically on saving. For example, the 4x4 transformation matrix for bone data is simply a numpy array.

[!IMPORTANT] Specify dtype=numpy.float32 for float arrays and dtype=numpy.uint32 for integer arrays to prevent conversion errors.

import numpy

# Assign the identity transform to each bone.
for bone in skel.bones:
    bone.transform = numpy.eye((4), dtype=numpy.float32)

# Assign the X coordinate for positions
for o in mesh.objects:
    o.positions[0].data[:, 0] += 1.0

After making any changes, the results can be saved back to a file. Using the same path used to read the files will overwrite the file. Even if no edits are made, the resulting file will likely not be binary identical with the original due to floating point rounding errors or the use of different algorithms.

mesh.save("model_new.numshb")
modl.save("model_new.numdlb")
skel.save("model_new.nusktb")

Documentation

The Python API is best summarized by the type stub (.pyi) files, which can be found here. The Python API matches the underlying Rust types and functions as closely as possible. The Rust documentation has much more detailed documentation and can be found at https://docs.rs/ssbh_data. For more advanced sample Python scripts, see the examples.

Building

Requires a recent version of Rust. The builds published to PyPi are built using Maturin. Aftering succesfully installing Maturin, running maturin develop --release in the ssbh_data_py directory will build and install the module into the current virtual environment.

maturin build --release builds the ssbh_data_py module that can be imported into Python. The resulting binary can only be used with the current Python version, processor type, and operating system. Rename the .dll to .pyd on Windows and the .dylib to .so on Linux or MacOS.

If the import fails, check that the .pyd or .so file exists in the appropriate location. Importing may also fail if ssbh_data_py was built from source for an operating system or Python interpreter version that isn't compatible with the current Python environment.

Metadata

Release files for ssbh-data-py 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for ssbh-data-py 0.9.1
File
ssbh_data_py-0.9.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
ssbh_data_py-0.9.1-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
ssbh_data_py-0.9.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
ssbh_data_py-0.9.1-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details
ssbh_data_py-0.9.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
ssbh_data_py-0.9.1-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
ssbh_data_py-0.9.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
ssbh_data_py-0.9.1-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details
ssbh_data_py-0.9.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
ssbh_data_py-0.9.1-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details
ssbh_data_py-0.9.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
ssbh_data_py-0.9.1-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details
ssbh_data_py-0.9.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
ssbh_data_py-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details
ssbh_data_py-0.9.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
ssbh_data_py-0.9.1-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details
ssbh_data_py-0.9.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
ssbh_data_py-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.34+ x86-64 Details
ssbh_data_py-0.9.1-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
ssbh_data_py-0.9.1-cp39-cp39-macosx_10_12_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.12+ x86-64 Details

Total release size: 18.2 MB

Release files / ssbh_data_py-0.9.1-cp313-cp313-win_amd64.whl

Download URL ssbh_data_py-0.9.1-cp313-cp313-win_amd64.whl
Size 890.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
a784cc555a674caa985659b302ab9cb7a5fa508b2b3b141e38027e235b456349
BLAKE2b-256 checksum
How to use checksums
4e6690564282a76e3082d50acc159b1bed4d4081830e374db0dbbc67bff2678c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp313-cp313-manylinux_2_34_x86_64.whl
Size 958.4 kB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
1abfaba6fb372454bc9f0100dd62a1e81fba2380fee148d9a477adb18dae525b
BLAKE2b-256 checksum
How to use checksums
0340e717dff864014c9f35d3b4a1e4af4df63fa2c595c89c651667111949721e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL ssbh_data_py-0.9.1-cp313-cp313-macosx_11_0_arm64.whl
Size 854.0 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
25d83efc00a247b8d88e13ce5e0ec22e6bfc2c2a174339956bdd070f25498856
BLAKE2b-256 checksum
How to use checksums
92a5ddce534982ad81549f7da2494ae8526aeefa99f16fcb85c8917b7981e24d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp313-cp313-macosx_10_12_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp313-cp313-macosx_10_12_x86_64.whl
Size 927.1 kB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4ac97efa7795026fcf9bfec83909c049ae831198af08afccff25f1471391f9f1
BLAKE2b-256 checksum
How to use checksums
65419d7996bd72fcf2dabaf7c4d9ed3e51c22a870b5386a61f2a6e47c6ce3369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp312-cp312-win_amd64.whl

Download URL ssbh_data_py-0.9.1-cp312-cp312-win_amd64.whl
Size 890.1 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ed7e1afaaf0fe5af20a7edb76a4378a273994aa0031d8c136073d1999588c72d
BLAKE2b-256 checksum
How to use checksums
5189c81e2610257c227deedb47983946bd41bc6fbb950bb3728d47e22e97bca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp312-cp312-manylinux_2_34_x86_64.whl
Size 958.8 kB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
880394bb21b70c75e6565de973147e66645f1fc9347770a7fd741e862bac476e
BLAKE2b-256 checksum
How to use checksums
07bf45b11fcd34a9ae882ce3d30df0c95cce0cdc6c3113f6460ad2742080d7a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL ssbh_data_py-0.9.1-cp312-cp312-macosx_11_0_arm64.whl
Size 854.2 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8afcf2f0ae34a204fef010ad34af5f60e8a6543f1272f1da59b939fe7ce9c7e2
BLAKE2b-256 checksum
How to use checksums
178444be5ebe4cbd81c91f6aa26871bfb883e47511b78635ee806c13c942b2cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp312-cp312-macosx_10_12_x86_64.whl
Size 927.6 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
24753ec54ad9fe0d4423a5f1d7f2df335ff87d1e3a21cac33d3d85d695ce7151
BLAKE2b-256 checksum
How to use checksums
81446b2fe1ef27caafbf1dba71429f6c9bf90878b7647ead7e4e297ba9a4ddc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp311-cp311-win_amd64.whl

Download URL ssbh_data_py-0.9.1-cp311-cp311-win_amd64.whl
Size 886.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
07a7b0a81a40d26799cd598f98135a40ebed8881b8ee01cd015433cba1ffd801
BLAKE2b-256 checksum
How to use checksums
1e14e7e8abb44c875bbe31d98a490ae90edab0dfdbc83963ce59284e3f34d714
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp311-cp311-manylinux_2_34_x86_64.whl
Size 958.8 kB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
faf08e6e59c856aa9aafdce8b23c878587e784bced549b3255e75e7412379819
BLAKE2b-256 checksum
How to use checksums
03f124b388058841b9f003d517ce23416ae4bce1b6e6d6b8896643d3e5f8a13d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL ssbh_data_py-0.9.1-cp311-cp311-macosx_11_0_arm64.whl
Size 867.0 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
48196ffd2ee8ca78b92e24647d09896ee555c8ac7c62b052a8ad7acd2a27dad2
BLAKE2b-256 checksum
How to use checksums
37e28efe365d30efbe17673897738d0f89725667bc2cf33758e49c8a01017266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp311-cp311-macosx_10_12_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp311-cp311-macosx_10_12_x86_64.whl
Size 940.4 kB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0c2855d32aee060c7546f9a07fe6679516378f807ab472330fc34331485a03bb
BLAKE2b-256 checksum
How to use checksums
259d0289fa16a1f46febf58ccdc419aaa68f381685b9d6a06cf55066addefb2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp310-cp310-win_amd64.whl

Download URL ssbh_data_py-0.9.1-cp310-cp310-win_amd64.whl
Size 886.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
dd446989c71fc8d61556827f7d516487b7267b13afd0739e8c382585d6bc0afc
BLAKE2b-256 checksum
How to use checksums
cbf292f2e425d8a9586694569a8c5daafb9b6ae19fa49b8934d156d491a0362d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp310-cp310-manylinux_2_34_x86_64.whl
Size 958.7 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
6bb52fc539455a620d866c4f4aaa3aca42df89426f0aa71b1cc1d2abaa4bc915
BLAKE2b-256 checksum
How to use checksums
855bd29504aa0cd5a48e50b965583427a8d22b2390dada63ec2ab3922b77847e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL ssbh_data_py-0.9.1-cp310-cp310-macosx_11_0_arm64.whl
Size 867.2 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0a4311259b040556fbb6ceeb58391a297554d41728950098a893218b6d6f4487
BLAKE2b-256 checksum
How to use checksums
5262dd605b573e4a84f25763e684d54466d80fbcc43f76a1a8591e10c616d98b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp310-cp310-macosx_10_12_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp310-cp310-macosx_10_12_x86_64.whl
Size 940.7 kB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
763f66d50bed6afe252cc065a61966385403d253b4379c0f02d08327721f7467
BLAKE2b-256 checksum
How to use checksums
ef42c3dbe3071fef28967878dd33485df4249f0517384a229a02f0ae57391cc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp39-cp39-win_amd64.whl

Download URL ssbh_data_py-0.9.1-cp39-cp39-win_amd64.whl
Size 888.9 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
563091035ba527bce69c05ae158b394d94ad222cddcdbf4cb547beb056dad08e
BLAKE2b-256 checksum
How to use checksums
2db42ef4ccc5d4145e35fc2a310908f5abad6079de6a0fa31745f670a7fca4c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp39-cp39-manylinux_2_34_x86_64.whl
Size 960.8 kB
Tags CPython 3.9 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
6867e6bf8f10e11fa3b3c634dfd603fcb0c8995af8c456ae6857a293b15e56ee
BLAKE2b-256 checksum
How to use checksums
07d3b17fff4e3a284d58f5afd4f6d188d399f36fe1cf58fead4760ccaaa2cfa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp39-cp39-macosx_11_0_arm64.whl

Download URL ssbh_data_py-0.9.1-cp39-cp39-macosx_11_0_arm64.whl
Size 869.2 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e6e823570209e44e2a6162d9d972d490482c897b45bbf74e2bd3d17a77a66fa0
BLAKE2b-256 checksum
How to use checksums
d5004443e2e3a768bb283d812115a619286ed873413979724c73bcde37d12e4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release files / ssbh_data_py-0.9.1-cp39-cp39-macosx_10_12_x86_64.whl

Download URL ssbh_data_py-0.9.1-cp39-cp39-macosx_10_12_x86_64.whl
Size 943.1 kB
Tags CPython 3.9 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
359ab264b7b9aa473879b68e3583680fe4f48554a700933b1fff74b9df630d95
BLAKE2b-256 checksum
How to use checksums
b0c877a803c6d2cbbba446c326324a01abbd4fd0179cf5f4da1c6838014e3cb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.6

Release history Release notifications | RSS feed

This release

0.9.1 This release

20 release files

0.8.3

22 release files

0.8.2

22 release files

0.8.0

14 release files

0.7.1

14 release files

0.6.2

10 release files

0.6.1

10 release files

0.6.0

9 release files

0.5.3

9 release files

0.5.2

9 release files

0.5.1

12 release files

0.5.0

12 release files

0.4.0

12 release files

0.3.0

12 release files

0.2.6

12 release files

0.2.4

12 release files

0.2.3

12 release files

0.2.2

8 release files

0.2.0

12 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page