Skip to main content

Convert Spine binary .skel files to JSON (Spine 4.2/4.3)

Project description

SkelToJson - Spine 2D Binary to JSON Converter

SkelToJson

Convert Spine 2D binary .skel files to human-readable JSON — supports Spine 4.2.x and 4.3.x.

What is Spine 2D?

Spine is a 2D animation tool widely used in games, apps, and web content. It lets artists rig a skeleton of bones onto 2D images, then animate them with keyframes — producing smooth, lightweight character animations without frame-by-frame sprite sheets.

.skel vs .json — What's Inside?

Spine exports skeleton data in two formats:

.skel — Binary format (compact, not readable)

The .skel file is a binary encoding of the entire skeleton. It's optimized for size and loading speed, but completely unreadable — it's just raw bytes:

c2b3a848 2ee43256 07342e32 2e343300
c3160000 c3de0000 43960000 44610000
42c80000 00011f61 6e746963 69706174
696f6e ...

.json — JSON format (human-readable, editable)

The JSON export contains the same data in a structured, readable format. Here's the structure:

Section Description
skeleton Metadata: Spine version, hash, dimensions, reference scale
bones Bone hierarchy — each bone has a name, parent, position, rotation, scale
slots Slots attached to bones — define draw order and which attachment is visible
skins Groups of attachments (images, meshes, bounding boxes) mapped to slots
ik IK (Inverse Kinematics) constraints — bones follow a target
transform Transform constraints — bones copy another bone's transform
path Path constraints — bones follow a path curve
physics Physics constraints — bones react to movement with inertia, gravity, wind
events Named events triggered at specific times in animations
animations All animations with keyframed timelines for bones, slots, attachments, constraints

Conversion Example

Input: anticipation.skel — 224 bytes of binary data

Output: anticipation.json — structured, readable:

{
  "skeleton": {
    "hash": "2ee43256c2b3a848",
    "spine": "4.2.43",
    "x": -150,
    "y": -444,
    "width": 300,
    "height": 900,
    "referenceScale": 100
  },
  "bones": [
    { "name": "root" }
  ],
  "slots": [
    {
      "name": "anticipation",
      "bone": "root",
      "attachment": "anticipationv2/anticipationv2_"
    }
  ],
  "skins": [
    {
      "name": "default",
      "attachments": {
        "anticipation": {
          "anticipationv2/anticipationv2_": {
            "y": 6,
            "width": 300,
            "height": 900,
            "sequence": { "count": 31, "start": 0, "digits": 2, "setup": 0 }
          }
        }
      }
    }
  ],
  "animations": {
    "animation": {
      "attachments": {
        "default": {
          "anticipation": {
            "anticipationv2/anticipationv2_": {
              "sequence": [
                { "mode": "loop", "index": 0, "delay": 0.03333 },
                { "time": 1, "mode": "loop", "index": 0, "delay": 0.03333 }
              ]
            }
          }
        }
      }
    }
  }
}

This is a simple skeleton with 1 bone, 1 slot, and a sequence-based attachment animation. Real game skeletons will have hundreds of bones, complex mesh deformations, IK chains, physics simulations, and dozens of animations.

Installation

pip install SkelToJson

CLI Usage

# Convert a single file
skel-to-json skeleton.skel

# Convert with custom output path
skel-to-json skeleton.skel -o output.json

# Convert all .skel files in a directory
skel-to-json skeletons/

# Convert directory with custom output directory
skel-to-json skeletons/ -o output/

Python API

from SkelToJson import convert_skel_to_json, convert_directory, SkelConverter

# Convert a single file
convert_skel_to_json("skeleton.skel", "skeleton.json")

# Convert all .skel files in a directory
convert_directory("skeletons/", "output/")

# Low-level: convert raw bytes to dict
converter = SkelConverter()
result = converter.convert(skel_bytes)

Supported Formats

Version Status
Spine 4.2.x ✅ Fully supported
Spine 4.3.x ✅ Fully supported

License

MIT

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

skeltojson-1.0.1.tar.gz (585.4 kB view details)

Uploaded Source

Built Distribution

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

skeltojson-1.0.1-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file skeltojson-1.0.1.tar.gz.

File metadata

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

File hashes

Hashes for skeltojson-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b3b2657103589b015852e2333bc50bf4c9431cc29f73ef7860581ac94718c03e
MD5 cf78d38d55ed4ce40dbed73601840453
BLAKE2b-256 a878c4b075aeb234a89fcdd68baed668455f398a64724c9b4840c70e68987285

See more details on using hashes here.

Provenance

The following attestation bundles were made for skeltojson-1.0.1.tar.gz:

Publisher: publish.yml on BastienGimbert/SkelToJson

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

File details

Details for the file skeltojson-1.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for skeltojson-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6a0c0c5a38c811c7b23074fb22381615edbbc0be42db2cd12468764228e8897
MD5 5f2f9c694b4f3fc7978525fa40a96b89
BLAKE2b-256 a62bf34e66b2d67c6d50044a02dd274597ba3dbe6bae9592dae29fc98f4f2e6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for skeltojson-1.0.1-py3-none-any.whl:

Publisher: publish.yml on BastienGimbert/SkelToJson

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