Registry / serialization / overpunch

overpunch

JSON →
library1.1pypypi✓ verified 82d ago

A library for parsing and formatting IBM mainframe overpunch (signed numeric) fields. Used to convert between human-readable numbers and the compact byte-level representations common in legacy COBOL systems. Current version 1.1, stable and rarely updated.

pip install overpunch
INSTALL
IMPORT
SIG · OVERPUNCH
O
overpunch
serializationpythonv1.1
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Decimal
from overpunch import Decimal
from overpunch import OverpunchParser
extract
from overpunch import extract
format
from overpunch import format

Parse overpunch bytes to int and format int to bytes.

from overpunch import OverpunchParser, OverpunchFormatter # Parse an overpunch byte string (last nibble holds sign) raw = b'\x12\x3d' # Example: two bytes, last nibble 'D' (negative) parser = OverpunchParser() result = parser.parse(raw) print(result) # -123 # Format a number to overpunch bytes formatter = OverpunchFormatter() formatted = formatter.format(456) print(formatted) # b'\x45\x6c' (positive)
Debug
Known issues
gotchaOverpunch sign nibble encoding: 'C' (positive), 'D' (negative), 'F' (unsigned positive). Ensure your source data uses IBM standard, as some variants differ.
fix
Check the last nibble of the last byte. Use parser.parse() which handles standard encodings.
affects: all
gotchaTrailing zeros not preserved: formatting an integer may result in bytes without expected leading zeros if the number of digits is less than the desired field width.
fix
Prefix zeros manually before formatting, e.g., format as a string with leading zeros, then convert to overpunch.
affects: all
deprecatedThe module previously allowed direct string-to-byte parsing without specifying width; v1.1 expects the byte array length to match the number's digit count plus sign nibble.
fix
When upgrading to 1.1, ensure your input byte strings have the correct length for the number of decimal digits plus one sign nibble.
affects: <=1.0
Upgrade
Version history
1.1latest on PyPI · released Apr 24, 2017
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
overpunch — pip install overpunch · libregistry