Skip to main content

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.

Metadata

Release files for PyPunch 1.0.0

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

Source distribution (sdist)

Source distribution for PyPunch 1.0.0
File Size Uploaded
PyPunch-1.0.0.tar.gz 121.9 kB Details

Built distribution (wheel)

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

Total release size: 243.4 kB

Release files / PyPunch-1.0.0.tar.gz

Download URL PyPunch-1.0.0.tar.gz
Size 121.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ae2cae303220fd620172fa48a01760a4da9005243bf21e6175bb45064ed3e1c7
BLAKE2b-256 checksum
How to use checksums
18a676380f1cdcab38ec470f0a136f33e1964a877398c6e0d0c9f5e09a2b11c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3

Release files / PyPunch-1.0.0-py3-none-any.whl

Download URL PyPunch-1.0.0-py3-none-any.whl
Size 121.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d93dda94a8d9d7bdc6b13d31b9dc559ce005182305a1a4ebbc1fbab3f2ae93d
BLAKE2b-256 checksum
How to use checksums
f713f4833cb8be4f8ed30e004d02d8d8c3f5821ee1681148a622f9dadfa1c619
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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