To read the binary files produce in CORSIKA7 simulations, the corsikaio python library can be used. These is described in
https://github.com/cta-observatory/pycorsikaio
The developers of CORSIKA8 provide a python library to work with the native CORSIKA8 output format. This is described in
https://gitlab.iap.kit.edu/AirShowerPhysics/corsika/-/tree/master/python