Skip to main content

pygoattracker

Pure-Python reader, writer, and player for GoatTracker 2 .SNG songs, with SID register-log output and audio rendering through an emulated SID.

Consumes .sid files (PSID/RSID containers) and bare .prg images through the shared pysidtracker base: the packed GoatTracker playroutine (as produced by gt2reloc) is detected and decompiled back to a Song, including crunched/relocated images whose init is run in a 6502 emulator — container headers are not trusted.

GoatTracker V1.x packed tunes (the V1.50–V1.53 standard playroutine and the V1.25 musicroutines 11.x) are recognized by their assembled playroutine, decompiled to a Gt1Song and played by a native Gt1Player; see docs/gt1.md. V1.x editor songs (GTS!) parse with parse_gts1 for all three layouts — the V0.9x body (no restart byte, $00-terminated wavetables), the V1.25 musicroutine body, and the V1.4b–V1.53 body with its 256-byte filtertable — round-trip with write_gts1, and relocate ports the editor's F9 relocator before playback (the V0.9x body is native-only).

TypedSong states the same song as typed operations (commands, table steps, instruments) and round-trips losslessly to the .sng and to the packed bytes; see docs/format.md.

Install

pip install pygoattracker

Reading, writing, playing, register logs, .sid decompiling (crunched/relocated images run in a 6502 emulator) and WAV rendering (pyresidfp) all come with the core install via pysidtracker.

Usage

Recover a song from a .sid file:

from pygoattracker import decompile_sid, write_sng

result = decompile_sid("tune.sid")     # path, bytes, or binary file object
song = result.song                     # the parsed Song model
write_sng(song, "tune.sng")            # a .SNG this library reads and plays

Read a GoatTracker .SNG song:

from pygoattracker import read_sng

song = read_sng("tune.sng")
print(song.name, song.author, song.copyright)

The player is one class deriving from pysidtracker.MemPlayer; its render is validated byte-exactly against a sidplayfp oracle across GoatTracker play-routine variations (see docs/oracle-testing.md).

See docs/usage.md for building songs, playback, register logs, WAV rendering, NinjaTracker 2, and the command line, docs/format.md for the format specification, data model, and .sid decompilation notes, and docs/oracle-testing.md for the byte-exact oracle tests.

Installed, it also registers the goattracker1 and goattracker2 formats with the pysidtracker CLI (pysidtracker info|reglog|wav tune.sid); see docs/usage.md.

Development

pip install -e ".[dev]"
./run_tests.sh        # black + pylint + pytest with coverage gate

License

Apache 2.0 — see LICENSE.

Metadata

Release files for pygoattracker 0.8.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 pygoattracker 0.8.0
File Size Uploaded Provenance Actions
pygoattracker-0.8.0.tar.gz 180.6 kB With provenance Details for pygoattracker-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 310.8 kB

Release files / pygoattracker-0.8.0.tar.gz

Download URL pygoattracker-0.8.0.tar.gz
Size 180.6 kB
Tags Source
SHA-256 checksum
How to use checksums
97f35f989db7d2413970b93da20da9320240957aaa1f1f1358c1e263e1205cf5
BLAKE2b-256 checksum
How to use checksums
d0f743b1d2aa4697902fdda03a7e53f094b68cac85ba10adb5250c1ebcfa86eb
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 Oct 24, 2026.

Transparency log

Release files / pygoattracker-0.8.0-py3-none-any.whl

Download URL pygoattracker-0.8.0-py3-none-any.whl
Size 130.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60e73c1c4927b67e36cbcc710a2f6f75200b3595f3e48345c5ead838e8fee9c0
BLAKE2b-256 checksum
How to use checksums
baa169d5b6590b85b19558906e8441b47b9646e1250d328e7771d5d81f15afb2
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 Oct 24, 2026.

Transparency log

Security for pygoattracker 0.8.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 pygoattracker-0.8.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 Oct 24, 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