d64py


Named64py JSON
Version 3.0.3 PyPI version JSON
download
home_page
SummaryCenbe's Commodore 64 Disk Image Library
upload_time2023-11-09 18:43:21
maintainer
docs_urlNone
author
requires_python>=3.11
license
keywords commodore geos
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### 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.base.DiskImage import DiskImage
from d64py.base.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()
```

**To dig deeper, you can find the API docs [here](https://www.lyonlabs.org/pydoc/d64py/) and the revision history [here](https://gitlab.com/Cenbe/d64py/-/blob/master/revision.history?ref_type=heads).**

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "d64py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "",
    "keywords": "Commodore,GEOS",
    "author": "",
    "author_email": "Glenn Holmer <cenbe@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/98/45/dc80fc3cb5219c2be0062b50ce03ad41a51edfc4cff8c8ead31e9fa23f73/d64py-3.0.3.tar.gz",
    "platform": null,
    "description": "### 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:\n\n**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):**\n\n```\nfrom pathlib import Path\nfrom d64py.base.DiskImage import DiskImage\nfrom d64py.base.Constants import CharSet\n\npath = Path(\"/your/image/here.d64\")\nimage = DiskImage(path)\n```\n\n**Now you can read the directory:**\n\n```\ndirEntries = image.getDirectory()\nfor dirEntry in dirEntries:\n    print(f\"{dirEntry.getDisplayFileName()}\")\n```\n\n**If you have a GEOS file, you can access the fields in the file header:**\n\n```\n    if dirEntry.isGeosFile():\n        geosFileHeader = dirEntry.getGeosFileHeader()\n        print(f\"permanent name string: {geosFileHeader.getPermanentNameString()}\")\n```\n\n**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.**\n\n```\ndirEntry = image.findDirEntry(\"firstBootSrc\", CharSet.ASCII)\npages = image.getGeoWriteFileAsLines(dirEntry)\nfor page in pages:\n    for line in page:\n        print(line.text)\n```\n\n**Don't forget to release the image's resources when you're through with it (the entire image gets memory-mapped):**\n\n```\nimage.close()\n```\n\n**To dig deeper, you can find the API docs [here](https://www.lyonlabs.org/pydoc/d64py/) and the revision history [here](https://gitlab.com/Cenbe/d64py/-/blob/master/revision.history?ref_type=heads).**\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Cenbe's Commodore 64 Disk Image Library",
    "version": "3.0.3",
    "project_urls": {
        "Changelog": "https://gitlab.com/Cenbe/d64py/-/blob/master/revision.history",
        "Documentation": "https://www.lyonlabs.org/pydoc/d64py/",
        "Repository": "https://gitlab.com/Cenbe/d64py.git"
    },
    "split_keywords": [
        "commodore",
        "geos"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3e28474395ff9e6b6a863f84ddaf68d1b63eee99333bbe4756ae4a3921d56d4",
                "md5": "b3de2d04a6b65029816e8ec9ece45a2d",
                "sha256": "0dfa09b63c398999e47dd11a01cc7b85a493d2b9de077551eeab806dffe76ce6"
            },
            "downloads": -1,
            "filename": "d64py-3.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b3de2d04a6b65029816e8ec9ece45a2d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 248249,
            "upload_time": "2023-11-09T18:43:20",
            "upload_time_iso_8601": "2023-11-09T18:43:20.009463Z",
            "url": "https://files.pythonhosted.org/packages/e3/e2/8474395ff9e6b6a863f84ddaf68d1b63eee99333bbe4756ae4a3921d56d4/d64py-3.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9845dc80fc3cb5219c2be0062b50ce03ad41a51edfc4cff8c8ead31e9fa23f73",
                "md5": "a6fd44129ae2f8683f2a18285652b802",
                "sha256": "e5ed8e1481290c34a305a06f50fde1ba732ecf998bf4c0e2993c04c4c5ce11c8"
            },
            "downloads": -1,
            "filename": "d64py-3.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a6fd44129ae2f8683f2a18285652b802",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 244588,
            "upload_time": "2023-11-09T18:43:21",
            "upload_time_iso_8601": "2023-11-09T18:43:21.863474Z",
            "url": "https://files.pythonhosted.org/packages/98/45/dc80fc3cb5219c2be0062b50ce03ad41a51edfc4cff8c8ead31e9fa23f73/d64py-3.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-09 18:43:21",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "Cenbe",
    "gitlab_project": "d64py",
    "lcname": "d64py"
}
        
Elapsed time: 0.13606s