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.0.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.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skeltojson-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 335d813394bb2ac73cf2c0d2dd6f405dc28697d89a56a2c57b61013e4a1f96b6
MD5 9e253b0e275e855757c1579c79faf199
BLAKE2b-256 78bcd1b33ed732501843c272a1194e5930b12333a5a1d13cb6d498d992723c44

See more details on using hashes here.

Provenance

The following attestation bundles were made for skeltojson-1.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: skeltojson-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad2a3a34b9ffcbb34f5804b1d31999e992e8afb3f76cc06c80f26cf572b9332f
MD5 aac3351eaedaa0be3f6418531e689e2b
BLAKE2b-256 904c29e6be91a961e18a9741c9c7df4a737995bc5f6141cf18254cf98790472f

See more details on using hashes here.

Provenance

The following attestation bundles were made for skeltojson-1.0.0-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