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.4-py3-none-win_amd64.whl (3.6 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

findent-4.3.4-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (4.1 MB view details)

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

findent-4.3.4-py3-none-macosx_14_0_x86_64.whl (944.9 kB view details)

Uploaded Python 3macOS 14.0+ x86-64

findent-4.3.4-py3-none-macosx_14_0_arm64.whl (918.6 kB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: findent-4.3.4-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.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 72b9989168a9463442ac5ad3fd131b8ff896b4c6f312d900cf56256e84310e92
MD5 2f9e017eb6190f9dbb88e5eb82d87b6a
BLAKE2b-256 868d9b07ac55a352382f8297e3b09225838c5759bc1d7881b0249fcb16039249

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for findent-4.3.4-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c74345b5719ab0f174e7441a9303117a21d9eb0f1d7065d84e1f0a5a660ee567
MD5 71458734fdeda5f71445631b207567d0
BLAKE2b-256 53b13424463e2925ba39d5cf46cb8ccda495d4e53e9860244e7814a1a69a9273

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for findent-4.3.4-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 17d20b9af59cd3ae2dd03c3459eee419f8803afdee9d76c3ff7e66993f369a3d
MD5 ba3d03a7bb1f208527e879804bebaf38
BLAKE2b-256 47640e30f43344490c8dc2e875f5a2b1f3476357945a13f2a2f9ff631480da54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for findent-4.3.4-py3-none-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 896f241b6dd8b3b5187259001634380ad168537e93a7826bd5ad5ee8f14b6a51
MD5 a8fb46a2818faad406e0583fc0a35814
BLAKE2b-256 d9aa55a6cae878200d9b27e87cde00af9a5d63e31c6e843b3b029dbf59f05472

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for findent-4.3.4-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 084f6c985914a39d0b6b2e679719807ba0bef6f08c08767ea3c0c62692fe4ba8
MD5 bdb381454261b2f9677830b75ba787c6
BLAKE2b-256 50f37590b5356e05d86bd95e7f9096510bd58d824576633f735786ec94fa2e1c

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