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 d64 import DiskImage

with DiskImage('test/data/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 d64 import DiskImage, ProgramFile

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

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

TODO

  • interactive shell utility
  • support .d71
  • support .d81
  • better docstrings
  • more examples
  • File write support
  • Entry deletion
  • Empty image creation
  • 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.5.tar.gz (144.5 kB view details)

Uploaded Source

Built Distribution

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

d64-0.5-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file d64-0.5.tar.gz.

File metadata

  • Download URL: d64-0.5.tar.gz
  • Upload date:
  • Size: 144.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for d64-0.5.tar.gz
Algorithm Hash digest
SHA256 00f201c3247924b5ea69768a09532e36a177f4172beea3b302dca026c0bb74af
MD5 d7b7586c81eaee93fcb90711835c8147
BLAKE2b-256 b0383676e01095edd6371b4f0f54df37e310d633c902da15cd6e9481086a3d6a

See more details on using hashes here.

File details

Details for the file d64-0.5-py3-none-any.whl.

File metadata

  • Download URL: d64-0.5-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for d64-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 671e76c4642cb48897b0da0eb468fc00f58b7e351393c9bf56bd802f939f3286
MD5 f45e1bd04f8dad77cbb23fc0b8d67e4f
BLAKE2b-256 4d413470599630f4b64acb6010959ee1b36bf1b4bda3b6e1e50ad29e6d96b668

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