Skip to main content

Mobile-friendly Supercell .sc decoder and encoder for Python

Project description

mb-sc-tools

mb-sc-tools is a Python library and CLI for decoding and encoding Supercell .sc files on phones and desktops.

It supports:

  • decoding .sc into PNG textures and data.json
  • encoding edited PNGs back into .sc
  • SC wrappers with zstd, lzma, and lz4 payloads
  • ARM64 phones and desktop systems
  • automatic astcenc download on first use for ASTC/KTX textures
  • configurable workspace, output paths, backup name, and ASTC encoder path

Install

pip install mb-sc-tools

CLI

mb-sc-tools

Or direct commands:

mb-sc-tools decode /path/to/ui.sc
mb-sc-tools encode /path/to/sc_decoded/ui

More explicit control:

mb-sc-tools decode /path/to/ui.sc \
  --workspace-root /tmp/sc-work \
  --output-dir /tmp/sc-work/custom/ui \
  --source-backup-name source.sc

mb-sc-tools encode /tmp/sc-work/custom/ui \
  --workspace-root /tmp/sc-work \
  --output /tmp/sc-work/sc_encoded/ui.sc

Python API

from pathlib import Path

from mb_sc_tools import (
    DecodeOptions,
    EncodeOptions,
    WorkspaceConfig,
    decode_to_workspace,
    encode_folder,
)

workspace = WorkspaceConfig(root=Path("/tmp/sc-work"))

decoded_dir, data = decode_to_workspace(
    Path("/sdcard/ui.sc"),
    options=DecodeOptions(
        workspace=workspace,
        source_backup_name="source.sc",
    ),
)

encoded_path = encode_folder(
    decoded_dir,
    options=EncodeOptions(
        workspace=workspace,
        output_path=Path("/tmp/sc-work/sc_encoded/ui.sc"),
    ),
)

Output layout

On Android/Termux, if /sdcard/sc exists the tool writes to:

  • /sdcard/sc/sc_decoded/<file_stem>/
  • /sdcard/sc/sc_encoded/<original_name>.sc

Otherwise it writes to a local ./sc/ workspace.

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

mb_sc_tools-0.1.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

mb_sc_tools-0.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file mb_sc_tools-0.1.1.tar.gz.

File metadata

  • Download URL: mb_sc_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for mb_sc_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fa67ef434505e6c560f1326a789f21dd47bb29ea7c749ba4e1c405b6598ea023
MD5 1de060291ac570db38e52f2fe9b576a8
BLAKE2b-256 761911ff986b414a61416a351839ed0ba2ad800c0c28a96ba2723029ba8a38bc

See more details on using hashes here.

File details

Details for the file mb_sc_tools-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mb_sc_tools-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for mb_sc_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53a2855e5ba5f781cc964dc2361a69e30c73e75f6637efb5aec41a4a6b941427
MD5 54f8de9a2cf612873c37f9a175833977
BLAKE2b-256 1f49935eb0d161cd375333a6f969a48ef6bab49b80a15cbf6c3e51d11da9b775

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