fprettify is an auto-formatter for modern Fortran source code. It automatically indents code, aligns statements, and supports Fortran 2003/2008 features. The current version is 0.3.7, released with Python 3 support only (dropped Python 2). Release cadence is irregular; latest release in 2021.
pip install fprettifyVerified import paths — ran on the pinned version, not inferred.
Basic usage: import the FortranFormatter class, then call format_file or format_directory.
Use Python 3 or pin to fprettify==0.3.6 if Python 2 is required.
Use the --diff flag (CLI) or check the diff before committing. In code, copy files beforehand.
Install fprettify with extras: pip install fprettify[config]