Skip to main content

findent: powerful Fortran formatter

Project description

PyPI Latest Release PyPi release

findent: powerful Fortran formatter


What is it?

findent indents/beautifies/converts and can optionally generate the dependencies of Fortran sources.


  • Supports Fortran-66 up to Fortran-2018
  • Converts from Fixed Form to Free Form and vice-versa
  • Honours cpp and coco preprocess statements
  • Honours OpenMP conditionals
  • Validated against all constructs in 'Modern Fortran explained, Incorporating Fortran 2018, Metcalf e.a.'
  • Supported platformrs: Unix and Windows
  • High speed: 50K - 100K lines per second
  • vim, gedit, emacs: findent optionally emits configuration files for these editors to use findent as a plugin.


Normal installation using pip

pip install findent

Supported platforms

OS Architecture
Linux x64, arm64, i686, aarch64, ppc64, s390x
MacOS x64, arm64
Windows x64


Format file in.f90 to out.f90

findent < in.f90 > out.f90

Format with 4-space indentation and convert Fixed Form in.f to Free Form out.f90

findent -i4 -ofree < in.f > out.f90

Format and refactor all files with .f extension in the current directory

wfindent -i4 -Rr *.f

Generating Fortran source dependencies for use in Makefile

findent will generate a dependency list for:

  • definitions and uses of modules and submodules
  • include, #include and ??include statements

In your Makefile add something similar to:

findent --makefdeps > makefdeps
chmod +x makefdeps

include deps
dep deps:
  ./makefdeps *.f90 > deps

The flag --makefdeps generates a script in the standard output. Depending on your usecase the script might not suffice and you will need to write your own version.

Editor incorporation

(G) VIM users

Installation instructions:

findent --vim_help


:help equalprg

:help indentexpr

GEDIT users

Installation instructions:

findent --gedit_help

EMACS users

Installation instructions:

findent --emacs_help

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

findent-4.3.1-py3-none-win_amd64.whl (3.8 MB view hashes)

Uploaded Python 3 Windows x86-64

findent-4.3.1-py3-none-musllinux_1_1_x86_64.whl (4.6 MB view hashes)

Uploaded Python 3 musllinux: musl 1.1+ x86-64

findent-4.3.1-py3-none-musllinux_1_1_i686.whl (4.4 MB view hashes)

Uploaded Python 3 musllinux: musl 1.1+ i686

findent-4.3.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.6 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

findent-4.3.1-py3-none-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl (3.5 MB view hashes)

Uploaded Python 3 manylinux: glibc 2.12+ i686 manylinux: glibc 2.17+ i686

findent-4.3.1-py3-none-macosx_11_0_arm64.whl (946.2 kB view hashes)

Uploaded Python 3 macOS 11.0+ ARM64

findent-4.3.1-py3-none-macosx_10_9_x86_64.whl (946.4 kB view hashes)

Uploaded Python 3 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page