pycobol2parquet
pycobol2parquet is a Python library to convert COBOL ebcdic file to parquet format.
I released pycobol2csv back in 2021 and it has been deployed to multiple production systems. One feedback I received is about the possibility of converting from Cobol to Parquet directly for analytical workload.
It is straightforward to reuse the same underline knowledge and code to generate Parquet file.
Install the python module:
pip install pycobol2parquet
To use the module:
from pycobol2parquet import convert_cobol_file, decode_copybook_file
row_length, cobol_struc = decode_copybook_file(copybook_file)
convert_cobol_file(copybook_file, data_file, output_file, codepage, debug=False)
- copybook_file: copybook filename
- data_file: data filename
- output_file: output parquet filename
- codepage: codepage for edibic, refer to https://docs.python.org/3.7/library/codecs.html#standard-encodings for details
- debug: enable for more debug information, default is OFF
Please refer to convert_cobol_test_main.py for details.
test
2 sets of test data have been created from scratch. Each set includes a copybook and an EBCDIC data file.
To test:
python convert_cobol_test_main.py --copybook testdata\test2\DWSTUB.txt --data testdata\test2\DWSTUB_DATA.DAT --output DWSTUB_DATA_output.parquet
known issues and limitations
- Be aware of the resources available in your runtime environment and make sure the Cobol file size is not beyond the limit or cause any performance issue.
To handle large Cobol files, you can split the files into smaller chunks and then process the chunks in parallel. Please refer to the medium post for details.
- When creating Parquet files the library detects data type automatically. This is to simplify the parameters passed to the conversion function.
Metadata
Release files for pycobol2parquet 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycobol2parquet-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / pycobol2parquet-0.0.3-py3-none-any.whl
| Download URL | pycobol2parquet-0.0.3-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0129a9fe9b2ade8f8cfc622357291938a0ec0c90f909bf51eaf7dd0e894f8f9
|
|
BLAKE2b-256 checksum How to use checksums |
55aed75cb1cf180cb1d127c01c52faca752538fa695addb9633d0ef009568201
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Security for pycobol2parquet 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.