{"id":26853,"library":"copybook","title":"copybook","description":"A Python library for parsing COBOL copybooks (data definition records). Current version 1.0.16. Development appears infrequent with no recent releases.","status":"active","version":"1.0.16","language":"python","source_language":"en","source_url":"https://github.com/zalmane/copybook","tags":["COBOL","copybook","parser","mainframe"],"install":[{"cmd":"pip install copybook","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Used for parsing copybook syntax","package":"pyparsing","optional":false}],"imports":[{"wrong":"from copybook import Copybook","symbol":"copybook","correct":"import copybook"},{"symbol":"Field","correct":"from copybook import Field"},{"symbol":"parse_file","correct":"from copybook import parse_file"}],"quickstart":{"code":"from copybook import Copybook\n\ncb = Copybook('')\ncb.parse(\n    struct=\"\n        01 RECORD.\n           05 NAME    PIC X(30).\n           05 AGE     PIC 9(3).\n    \"\n)\nprint(cb.layout)\n# Example output: {'NAME': (1, 30), 'AGE': (31, 33)}","lang":"python","description":"Parse a COBOL copybook string and get field positions."},"warnings":[{"fix":"Use open('copybook.cbl').read() to get the content, then pass it to parse.","message":"The parse method does not accept file paths; you must read the copybook file yourself and pass the content as a string.","severity":"gotcha","affected_versions":"all"},{"fix":"When using layout offsets, remember that the first byte is 1. Adjust if your downstream expects 0-based.","message":"Copybook layout indices are 1-based, not 0-based.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.0.16':14 'appear':16 'cobol':7,22 'copybook':1,8,23 'current':12 'data':9 'definit':10 'develop':15 'infrequ':17 'librari':4 'mainfram':25 'pars':6 'parser':24 'python':3 'recent':20 'record':11 'releas':21 'version':13","created_at":"2026-05-01T17:43:12.947018+00:00","updated_at":"2026-05-01T17:43:12.947018+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/zalmane/copybook","docs":null,"changelog":null,"pypi":"https://pypi.org/project/copybook/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}