Skip to main content

This project is a Python library for writing programs to explore Commodore 64 disk images; my Disk Wrangler (q.v.) is based on it. It's particularly good at dissecting GEOS disks. Here's how to get started:

Create a DiskImage object. Just pass a Path to the constructor; he'll detect the image type (or raise an Exception if it's not one):

from pathlib import Path
from d64py.DiskImage import DiskImage
from d64py.Constants import CharSet

path = Path("/your/image/here.d64")
image = DiskImage(path)

Now you can read the directory:

dirEntries = image.getDirectory()
for dirEntry in dirEntries:
    print(f"{dirEntry.getDisplayFileName()}")

If you have a GEOS file, you can access the fields in the file header:

    if dirEntry.isGeosFile():
        geosFileHeader = dirEntry.getGeosFileHeader()
        print(f"permanent name string: {geosFileHeader.getPermanentNameString()}")

Say there's a geoWrite file on the disk, and you'd like to quickly see what's in it. We can ask the disk image to find the directory entry for us (if we specify CharSet.PETSCII, the filename will be translated to PETSCII first). All the routines that return lines of text return TextLine objects, which is just a helper class that includes a line of text and an error flag (for e.g. printing in red). geoWrite files return a list of pages, each of which is a list of TextLines.

dirEntry = image.findDirEntry("firstBootSrc", CharSet.ASCII)
pages = image.getGeoWriteFileAsLines(dirEntry)
for page in pages:
    for line in page:
        print(line.text)

Don't forget to release the image's resources when you're through with it (the entire image gets memory-mapped):

image.close()

Metadata

Release files for d64py 3.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for d64py 3.2.1
File Size Uploaded Provenance Actions
d64py-3.2.1.tar.gz 256.5 kB Without provenance Details for d64py-3.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 514.9 kB

Release files / d64py-3.2.1.tar.gz

Download URL d64py-3.2.1.tar.gz
Size 256.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0cb8166d7d08e716c7f9481eb19693c50384a1c596c361e80c6134c43f4cf0c4
BLAKE2b-256 checksum
How to use checksums
f605caa9cf5152500fd1826dc327ca6ed3f3d1322e4ebdf5e0a688eb4d1f08d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / d64py-3.2.1-py3-none-any.whl

Download URL d64py-3.2.1-py3-none-any.whl
Size 258.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5032648631dd4033ab59ce635ac2e09dfc6a0ff1f665b5be4cf984375d4da6f4
BLAKE2b-256 checksum
How to use checksums
cea356cb857e0f40517b68af64bfa03694cd3e0bbb8797ce00984ad471638d46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for d64py 3.2.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

3.2.1 This release

2 release files No provenance

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