PyForTool
Python-fortran-tool
Loading...
Searching...
No Matches
PyForTool API Reference

This section contains the auto-generated API reference from source code docstrings.

For general documentation, see:

Main Classes

Class Description
PYFT Main class for file operations
PYFTscope Scope-level operations
VarList Variable management
Tree Cross-file dependency tracking

Module Reference

Module Description
pyfortool.variables Variable declaration management
pyfortool.statements Statement manipulation
pyfortool.cosmetics Code formatting
pyfortool.applications High-level transformations
pyfortool.cpp Preprocessor directives
pyfortool.openacc OpenACC directives
pyfortool.tree Dependency analysis
pyfortool.expressions Expression helpers
pyfortool.util Utilities and decorators

Quick Examples

Basic File Operations

from pyfortool import PYFT
# Read, transform, write
pft = PYFT('input.F90')
pft.upperCase()
pft.write()

Scope Navigation

# Get specific scope
sub = pft.getScopeNode('module:MOD/sub:SUB')
# Find variables
var = sub.varList.findVar('X')

Code Transformations

# Remove calls and simplify
pft.removeCall('FOO', simplify=True)
# Expand array syntax
pft.removeArraySyntax(concurrent=True)
# Add profiling
pft.addDrHook()