Skip to main content

Read and write Commodore disk images

Project description

d64

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

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

In addition it contains tools useful to inspect and modify images, for example a script to check the integrity of 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
  • support for .d81
  • better docstrings
  • more examples
  • 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.11.tar.gz (38.3 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.11-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: d64-0.11.tar.gz
  • Upload date:
  • Size: 38.3 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.11.tar.gz
Algorithm Hash digest
SHA256 c4c1f5a73a43b9aed943153efd4c9da181a297150ced9bc09c564b1689ce3418
MD5 60c6d130e63536ba9e7a06c5ec5c6ea9
BLAKE2b-256 376bb08de172a47a279a0c802f5554eee0adc5c61418480b53bf1cb34102d7e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: d64-0.11-py3-none-any.whl
  • Upload date:
  • Size: 30.6 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.11-py3-none-any.whl
Algorithm Hash digest
SHA256 dd50921076066c4f69d0c8cb4fd907cc25ead404b162a5496bedcea70727c1e2
MD5 84cc799739bbd3478a437094192cb3e1
BLAKE2b-256 f6738e16a6cbe2ebacb1e8868211dd3a59781145e35781d5eb93d8c3fbbdf8d9

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