Skip to main content

Read and write Commodore disk images

Project description

d64

This Python module enables access to disk image files (.d64) used by various Commodore microcomputer emulators and tools.

It provides familiar interfaces for developers to read (and eventually write) program and data files within an image.

Examples

Classes and functions reside in the d64 module, the whole module may be imported or just those definitions referenced by the user.

Displaying an image contents

To perform a directory list

from pathlib import Path
from d64 import DiskImage

with DiskImage(Path('squadron.d64')) as image:
    for line in image.directory():
        print(line)

This prints out

0 "SQUADRON        " Q9 2A
15   "SQUADRON PAL"     PRG
15   "SQUADRON NTSC"    PRG
634 BLOCKS FREE.

Listing a BASIC program

To display a BASIC program as text

from pathlib import Path
from d64 import DiskImage, ProgramFile

with DiskImage(Path('test.d64')) as image:
    with image.path("METEOR").open() as f:
        p = ProgramFile(f)

for line in p.list():
    print(line)

TODO

  • Detailed documentation
  • interactive shell utility
  • image check/recovery utility
  • support for .d71
  • support for .d81
  • better docstrings
  • more examples
  • REL file write support
  • Selectable BASIC token sets
  • codec support (use cbmcodecs)

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

d64-0.7.tar.gz (26.2 kB view hashes)

Uploaded Source

Built Distribution

d64-0.7-py3-none-any.whl (24.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page