Stingray - Schema-Based File Reader Blog
Simple handling of numerous data file formats, even COBOL EBCDIC.
Brought to you by:
slott56
Version 4 dates from March, 2014. It switches to Python3.3. This is a rewrite. It doesn't use 2to3 or six.
If you're forced to use Python 2, you'll have to have a two-part application. The Stingray parts use Python3.3. All the other parts use Python2.
Added a "replacing" option to the COBOL Schema Loader.
with open("xyzzy.cob", "r") as cobol: schema= stingray.cobol.loader.COBOLSchemaLoader( cobol, replacing=("'WORD'", "BAR") )
The idea is to permit a copybook that expects "REPLACING" to be parsed.
Handle multiple 01-level declarations in a single COBOL copybook file. This simply creates more names in the schema.
Added a COBOL demo to show how to process a file with an external schema.