Skip to main content

tamago

Multi-format game archive toolkit.

Requires Python 3.10 or later.

Supported formats

Format Engine Extract Create
XP3 KiriKiri yes yes
DET μ-GameOperationSystem yes yes
GSP AGSD yes yes
ARC AdvHD (WillPlus V2) yes yes
VF LiveMaker yes yes
RPA Ren'Py yes yes
DXA DxLib (versions 1–4) yes yes
MED Fudegaki Soft (DxLib) yes yes
PCK ANIM (*_wave.pck, psbpack.dat) yes yes
YPF YU-RIS (versions 461–500; also YSTB scripts and YCG images) yes yes
DAT BlackRainbow ADVDX (.dat/.pak; also _BMD images) yes yes
PSB E-mote models (versions 2–4; e.g. from ANIM's psbpack.dat) yes yes

Installation

pip install tamagoarc

Usage

tamago CLI

tamago auto-detects archive formats by magic bytes and, for XP3 archives, automatically identifies the correct encryption scheme.

# Identify an archive's format
tamago identify data.xp3

# Extract an archive (auto-detects format and encryption)
tamago extract data.xp3 output_dir

# Use format subcommands for format-specific options
tamago xp3 extract data.xp3 output_dir --encryption hash-xor --key 3
tamago det create source_dir output.det --index-format atm

# Create an archive (format must be specified)
tamago create --format xp3 source_dir output.xp3

ANIM games also encipher their scripts and images as single files (*_sce.dat, *_define.dat, cg/*.gax). Decrypt or encrypt a file, or every such file under a directory:

tamago anim decrypt game_dir/cg/BG010.gax BG010.png
tamago anim decrypt game_dir decrypted_dir
tamago anim encrypt decrypted_dir enciphered_dir

YU-RIS archives must be recreated with the version, name key and name-length table the game expects. --like copies them from one of the game's own archives:

tamago yuris extract pac/cg.ypf cg_dir --convert-ycg   # YCG images (stored as .png) become real PNGs
tamago yuris create cg_dir cg.ypf --like pac/cg.ypf --encode-ycg
tamago yuris decrypt ysbin_dir plain_dir               # YSTB scripts; the key is recovered automatically
tamago yuris encrypt plain_dir ysbin_dir --key 96ac6fd3
tamago yuris decode-ycg ycg_dir png_dir                # standalone YCG <-> PNG conversion
tamago yuris encode-ycg png_dir ycg_dir

BlackRainbow ADVDX archives address their members by slot number, and many members have no name. Extraction writes _advdx_manifest.json next to the files, recording each member's slot and stored name and the archive's header. create reads it back, so an extracted archive is rebuilt with every member in its slot. Script and read-flag archives carry a game ID that the game checks; the manifest keeps it, or give it with --game-id:

tamago blackrainbow extract image/sj_bga.dat bga_dir --convert-bmd   # _BMD images become PNG
tamago blackrainbow create bga_dir sj_bga.dat                         # PNGs are encoded back to _BMD
tamago blackrainbow create spt_dir sj_spt.dat --kind script --game-id 15432 --slots 192
tamago blackrainbow decode-bmd bmd_dir png_dir                        # standalone _BMD <-> PNG conversion
tamago blackrainbow encode-bmd png_dir bmd_dir

E-mote PSB files are decompiled to psb.json (the value tree), the resource chunks (resources/0.bin, ...) and the texture atlases as PNG, and compiled back from the JSON and chunks. The encryption key is recovered from version 3 and 4 files; ANIM's is built in, and others can be given with --key. The tree in psb.json writes single-precision floats as plain numbers, and resource references and other values JSON lacks as one-key objects ({"$resource": 0}):

tamago psb extract Malice100.psb model_dir     # psb.json, resources/, textures/*.png
tamago psb create model_dir Malice100.psb      # encrypted as the original was (--no-encrypt for a plain file)
tamago psb decrypt Malice100.psb plain.psb
tamago psb info Malice100.psb

Python API

from tamago.formats.xp3 import XP3File

# Extract an archive
with XP3File("data.xp3") as xp3:
    xp3.extract_all("output_dir")

# Extract with explicit encryption
from tamago.formats.xp3.encryption import HashXorEncryption

enc = HashXorEncryption(shift=3)
with XP3File("data.xp3", encryption=enc) as xp3:
    xp3.extract_all("output_dir")

# Auto-detect encryption
from tamago.formats.xp3.detect import auto_detect

enc = auto_detect("data.xp3")
with XP3File("data.xp3", encryption=enc) as xp3:
    xp3.extract_all("output_dir")

# Create an archive
from pathlib import Path

with XP3File("output.xp3", "x") as xp3:
    xp3.write_all(Path("source_dir"))

XP3 Encryption

XP3 archives used by KiriKiri games are often encrypted with a game-specific scheme implemented in a .tpm plugin. tamago supports the encryption used by several games (including automatic detection of the encryption).

If the game you are interested in is not supported, please raise an issue, including a VNDB link to the game.

Development

This project uses Hatch as the build system.

Setup

pip install hatch

Running tests

hatch run test                    # run all tests
hatch run test -k test_name       # run a single test by name
hatch run cov                     # tests + coverage report

Linting and formatting

hatch run lint:style     # check style (ruff + black)
hatch run lint:typing    # type checking (mypy)
hatch run lint:fmt       # auto-format (black + ruff --fix)
hatch run lint:all       # style + typing

License

tamago is distributed under the terms of the MIT license.

Metadata

Release files for tamagoarc 1.6.0

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

Source distribution (sdist)

Source distribution for tamagoarc 1.6.0
File Size Uploaded Provenance Actions
tamagoarc-1.6.0.tar.gz 366.6 kB With provenance Details for tamagoarc-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tamagoarc 1.6.0
File Interpreter ABI Platform Actions
tamagoarc-1.6.0-py3-none-any.whl Python 3 none any Details for tamagoarc-1.6.0-py3-none-any.whl

Total release size: 763.3 kB

Release files / tamagoarc-1.6.0.tar.gz

Download URL tamagoarc-1.6.0.tar.gz
Size 366.6 kB
Tags Source
SHA-256 checksum
How to use checksums
15c5b262f577d4bb0d59bcc3f09ae5e50afc3f690c91c362077fc7c5fca352af
BLAKE2b-256 checksum
How to use checksums
2ec739464a83d06d677e6be9387ea82a883414dc15bde1700abff607d4120660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / tamagoarc-1.6.0-py3-none-any.whl

Download URL tamagoarc-1.6.0-py3-none-any.whl
Size 396.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39a437dbdf17e3cd280a13553fb847dd0b98be90747b16c061fc19c9395d52f0
BLAKE2b-256 checksum
How to use checksums
3a542f73666ee883340ef32f9c7c9748d5fc1e84c2bea5712f634780329d44db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for tamagoarc 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tamagoarc-1.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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