Hi there,
Fortranformat is a library that emulates the functionality of FORTRAN
format statements in Python.
>>> import fortranformat as ff
>>> line = ff.FortranRecordReader('(4I4)')
>>> line.read(' 1 2 3 4')
[1, 2, 3, 4]
>>> line = ff.FortranRecordWriter('(4I4)')
>>> line.read([1, 2, 3, 4])
' 1 2 3 4'
It is extensively unit tested (to a degree that I was able to file a
bug report or two to the gfortran people!) but not tested in practice.
I'd appreciate some feedback.
It is available on PyPi and the project homepage is
https://bitbucket.org/brendanarnold/py-fortranformat
Try it out with:
pip install fortranformat
Kind regards,
Brendan