--- id: fparser version: "0.2.4" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # fparser — Python implementation of a Fortran parser License: permissive · Maintenance: active · Downloads: 115.7K/mo ## What it is and what it does fparser is a pure-Python Fortran parser that converts Fortran source code into an abstract syntax tree for programmatic inspection and transformation. It evolved from the parser originally built for the F2PY project and now supports Fortran standards from 77 through 2008, including modern extensions like OpenMP sentinels and F2008 intrinsic functions. The parser is designed for developers and researchers who need to analyze, transform, or generate Fortran code programmatically. It has no external runtime dependencies, making it lightweight to integrate into build pipelines, code analysis tools, or scientific computing workflows. Recent releases have focused on correctness—fixing edge cases in string handling, loop constructs, and directive processing—and expanding F2008 support. Use it for: - Analyze Fortran codebases to extract structure, dependencies, or metrics for documentation or refactoring. - Build code generation or transformation tools that read Fortran and emit modified or translated code. - Integrate Fortran parsing into scientific computing pipelines that need to inspect or validate legacy code. - Develop IDE or editor plugins that require Fortran syntax understanding for highlighting or navigation. - Automate migration or modernization of Fortran code by parsing and rewriting specific constructs. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. fparser parses Fortran source code (Fortran 77 through 2008) into an abstract syntax tree, enabling programmatic analysis and manipulation of Fortran programs. Yes, if you need to parse or analyze Fortran code programmatically. The package is actively maintained, has no external dependencies, and supports modern Fortran standards. Beta status and the lack of a stable API guarantee mean you should pin the version in production code, but the frequent releases and recent bug fixes suggest a maturing project. ## Install pip install fparser uv add fparser poetry add fparser ## Installing fparser Before you install: Low install friction with no runtime dependencies. Actively maintained with frequent releases; version 0.2.4 was released 49 days ago with bug fixes and F2008 support improvements. License in practice: BSD-3-Clause permissive license allows use in most projects without significant restrictions. Quickstart: pip install fparser from fparser.two import parse_file tree = parse_file('example.f') Requires Python 3.6 or later. Verify before relying: - Whether the parser handles all Fortran dialects equally well or has known limitations with specific extensions. - Performance characteristics on large codebases or deeply nested structures. - API stability guarantees given the beta development status. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 115.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fortran parser python, parse fortran code, fortran syntax tree, fortran ast, fortran source analysis, fortran code parsing, fortran language parser, fortran, parser, code-analysis [View on SkillFed](https://skillfed.io/packages/fparser) · [View on PyPI](https://pypi.org/project/fparser/)