Skip to main content

Python codecs for PETSCII encodings

Project description


The cbmcodecs package provides a number of encodings for handling text from Commodore 8-bit systems. Much of the credit for this package must go to Linus Walleij of Triad, as these codecs were built from his PETSCII to Unicode mappings which can be found at The screencodes codec was created by hand later and borrows from them.


Currently there are four codecs defined for variations of the PETSCII encoding:


The English version of the Commodore 64 mixed-case character set


The English version of the Commodore 64 upper-case/graphics character set


The English version of the VIC-20 mixed-case character set


The English version of the VIC-20 upper-case/graphics character set

There are two codecs defined to handle the Screencode (POKE) encoding:


Mixed-case mapping to screencodes (POKE) used by the Commodore 64 and Vic20


Upper-case/graphics mapping to screencodes (POKE) used by the Commodore 64 and Vic20

Simply import the cbmcodecs package and you will then be able to use them as with any of the encodings from the standard library:

import cbmcodecs

with open('file.seq', encoding='petscii-c64en-lc') as f:
    for line in f:

Python Version Note

Currently only Python 3 is supported (tested on 3.5+). May or may not work on older versions.


As with the original PETSCII to Unicode mapping files, the cbmcodecs package is Licensed under the GNU GPL Version 2, see the LICENSE.txt file for the full text.

Unicode symbols used

Aside from the regular alphanumerics and symbols, the unicode mapping uses the following unicode block drawing and other symbols to mimic a bunch of PETSCII characters:

£ π ✓ ← ↑ ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ ╭ ╮ ╯ ╰ ╱ ╲ ╳ ▁ ▂ ▃ ▄ ▌ ▍ ▎ ▏ ▒ ▔ ▕ ▖ ▗ ▘ ▚ ▝ ○ ● ◤ ◥ ♠ ♣ ♥ ♦


Linus Walleij - Original C64 and VIC-20 mappings Dan Johnson - Translation of C64 & VIC-20 mappings to python codecs Irmen de Jong - Screencode mappings, bug fixes and unit tests.

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

cbmcodecs-0.2.0.tar.gz (15.1 kB view hashes)

Uploaded source

Built Distribution

cbmcodecs-0.2.0-py3-none-any.whl (21.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page