Skip to main content

A Punchcard generation package

Project description

PyPunch

Python Punch Card Maker

Quality Gate Status PyPI version fury.io GitHub license

Overview

This package creates a simple graphical representation of an old IBM 029 keypunch puchcard. By default, saves the punch card to out_card.png. This can be changed by specifying a different filepath (see below). It uses Pillow internally, so most image types are supported, depending on filename extension.

Usage

The following methods are available:


PyPunch.build_card(command: str = "Example Command", out_file="out_card.png"):

This is the main function of this module. Optionally takes a command and a filename, then generates a punch card with this command, and saves it at out_file.

NOTE: THIS IS NOT A COMPILER! The output of this module is just an encoded string. Compilation is much more complex, and requires knowledge of the whole program and system architecture, and is therefore left as an exercise for the reader.


PyPunch.mappings:

This is a dict consisting of valid characters mapped to a list of the positions that need to be punched out of the card. For example, 'I': (0, 11) indicates that punching I requires a punch in positions 0 and 11.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for PyPunch, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size PyPunch-1.0.0-py3-none-any.whl (121.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size PyPunch-1.0.0.tar.gz (121.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page