Skip to main content

findent: powerful Fortran formatter

Project description

PyPI Latest Release PyPi release

findent: powerful Fortran formatter

alt

What is it?

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

Features

  • 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.

Installation

Normal installation using pip

pip install findent

Supported platforms

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

Examples

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

Documentation:

: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

If you're not sure about the file name format, learn more about wheel file names.

findent-4.3.3-py3-none-win_amd64.whl (3.6 MB view details)

Uploaded Python 3Windows x86-64

findent-4.3.3-py3-none-musllinux_1_2_x86_64.whl (5.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

findent-4.3.3-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.0 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

findent-4.3.3-py3-none-macosx_14_0_x86_64.whl (944.1 kB view details)

Uploaded Python 3macOS 14.0+ x86-64

findent-4.3.3-py3-none-macosx_14_0_arm64.whl (918.4 kB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file findent-4.3.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: findent-4.3.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for findent-4.3.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 fc1491f4ac9ef3405e94a0922d6568815f279d37cbf625da729be53f6711e554
MD5 2054f87a5b70d21a5cf65100086d9052
BLAKE2b-256 9f1a8247e20a5a4979c42f01c35591a754d8765dfb39c87c1264ea36341c31fa

See more details on using hashes here.

File details

Details for the file findent-4.3.3-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for findent-4.3.3-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e7ff4905bb55dafde5be0fe9ccbd286eb2f86428732af9061e552e5299c97c15
MD5 e1adf285ec2ad403b3607f47c04ce0f5
BLAKE2b-256 24ca2d6aaeab1a8084a980d5ee8b21113ad18552e64d6335d03a45a8d3d402d2

See more details on using hashes here.

File details

Details for the file findent-4.3.3-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for findent-4.3.3-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a56e108a556403261fb5f76a36ae007c936573315572f2dee27eaad7df719070
MD5 d7a29644c67b5b47c2eef34919e917b9
BLAKE2b-256 6adb98460cff852a09926e1fb6a5ce3a4333d07df6c36551046e7ac63c20fb6a

See more details on using hashes here.

File details

Details for the file findent-4.3.3-py3-none-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for findent-4.3.3-py3-none-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 611970119ee51fa56f3253096a871c97d7cf1819e5ba2b141200ced2a4e93ca1
MD5 42f2791d49607a4f8d50b7248d806e69
BLAKE2b-256 af10e02c03f4db066c6274a96a5d94ff7af1a2f406871dfe3f15f43951e39f84

See more details on using hashes here.

File details

Details for the file findent-4.3.3-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for findent-4.3.3-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 69f7cc247ec1e84da2b22233ea855e66d897469c9dd286a2f8a11051ea9ebaf9
MD5 0ddc6f03f4ee9c96be8d9f72f208dc80
BLAKE2b-256 c86f513ce234c77e0ef1fe892a73be4abd7727d0d99e515f76a983ef07df168a

See more details on using hashes here.

Supported by

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