Skip to main content

Shared base for pure-Python C64 SID tracker parsers: PSID/RSID container, loaded-image model, and packed/relocating playroutine detection

Project description

pysidtracker

Shared base for the pure-Python C64 SID tracker parsers (pygoattracker, pysidwizard, pydmcsid, pyfuturecomposer, pymusicassembler, pydefmon, pyjch).

Provides one implementation of the pieces every format parser duplicated:

  • parse_sid_header / SidHeader — PSID/RSID container header parsing.
  • SidImage — a loaded 64 KiB C64 memory image with absolute-addressed accessors, from a .sid container or a bare .prg.
  • read_bytes — path / bytes / file-like source dispatch.
  • SidError hierarchySidParseError, SidFormatError, EmulatorUnavailable.
  • detect_playroutine / PlayroutineKind — the untrustworthy-header detector: static signature recognition first, then an emulated init run to classify DIRECT / RELOCATED / PACKED / UNKNOWN playroutines.
  • BaseSidParser — the class each format subclasses for a consistent read / parse / detect API.

Install

pip install pysidtracker          # core (stdlib only)
pip install pysidtracker[emu]     # + py65, to unpack packed/relocating tunes
pip install pysidtracker[fast]    # + numpy, to accelerate the image scan

Usage

from pysidtracker import BaseSidParser, PlayroutineKind

class MyParser(BaseSidParser):
    def recognize(self, image):
        return image.find(b"MYSIG")          # truthy anchor when found
    def parse(self, data, **kw):
        image = self.load_image(data)
        ...                                    # decode image.mem into a model

det = MyParser().detect("tune.sid")
if det.kind is PlayroutineKind.PACKED:
    ...                                        # header was not trustworthy

See docs/design.md for the detection model and how the format packages consume this base.

Development

pip install -e ".[dev]"
pytest --cov=pysidtracker

Apache-2.0 licensed.

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

pysidtracker-0.1.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

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

pysidtracker-0.1.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file pysidtracker-0.1.0.tar.gz.

File metadata

  • Download URL: pysidtracker-0.1.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysidtracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d373aecc320a38260c3d6e057f1cb313888d0b837a55e15556aef6c5595cd8c4
MD5 24fea236e0368a2d1781c3b6dc1a13f4
BLAKE2b-256 c795c941e460962506fd74c69dc9b4646e982b98a73418d60365a059ea86c6e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysidtracker-0.1.0.tar.gz:

Publisher: publish.yml on anarkiwi/pysidtracker

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

File details

Details for the file pysidtracker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysidtracker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysidtracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f1999036c413b3b5a6137909e892f86bcf7910a44a29e2b9bf16996bb6973a3
MD5 0a583a9bba05e9b8c7204123633b521d
BLAKE2b-256 0a7d12e86d2cf952a1db9154b09fbb2e6146a7b2d87d8d2bcfc1c604cdac0476

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysidtracker-0.1.0-py3-none-any.whl:

Publisher: publish.yml on anarkiwi/pysidtracker

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