{"id":23763,"library":"fprettify","title":"fprettify","description":"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.","status":"active","version":"0.3.7","language":"python","source_language":"en","source_url":"https://github.com/pseewald/fprettify","tags":["fortran","formatter","code-style","auto-format"],"install":[{"cmd":"pip install fprettify","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Optional dependency for config file support (via --config-file)","package":"configargparse","optional":true}],"imports":[{"note":"The main formatter class is inside the fprettify module; direct import of the package doesn't expose the class.","wrong":"import fprettify","symbol":"fprettify","correct":"from fprettify import fprettify"}],"quickstart":{"code":"from fprettify import fprettify\nformatter = fprettify.FortranFormatter()\n# Format a single file\nformatter.format_file('source.f90')\n# Or format a directory recursively\nformatter.format_directory('.')","lang":"python","description":"Basic usage: import the FortranFormatter class, then call format_file or format_directory."},"warnings":[{"fix":"Use Python 3 or pin to fprettify==0.3.6 if Python 2 is required.","message":"Python 2 support was dropped in v0.3.7. If you are on Python 2, you must use an older version.","severity":"breaking","affected_versions":"< 0.3.7"},{"fix":"Use the --diff flag (CLI) or check the diff before committing. In code, copy files beforehand.","message":"By default, fprettify overwrites files in place. There is no backup unless you use version control.","severity":"gotcha","affected_versions":"all"},{"fix":"Install fprettify with extras: pip install fprettify[config]","message":"Optional dependency configargparse is required for config file support. Without it, --config-file fails silently or errors.","severity":"gotcha","affected_versions":">=0.3.4"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install configargparse or pip install fprettify[config]","cause":"Using --config-file without installing the optional dependency.","error":"ModuleNotFoundError: No module named 'configargparse'"},{"fix":"Use: from fprettify import fprettify","cause":"Incorrect import: import fprettify instead of from fprettify import fprettify.","error":"AttributeError: module 'fprettify' has no attribute 'FortranFormatter'"},{"fix":"Provide the file path: formatter.format_file('myfile.f90')","cause":"Calling format_file without arguments.","error":"TypeError: format_file() missing 1 required positional argument: 'filename'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}