fypp
Python powered Fortran preprocessor
Decision gist · record as of 2026-08-14
Yes. Fypp is actively maintained, has no runtime dependencies, installs easily, carries a permissive BSD license, and solves a real problem for Fortran developers needing template metaprogramming and conditional compilation. It is production-stable and suitable for integration into scientific computing and numerical library build pipelines.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.5 or above; designed for Fortran development workflows.
- Low install friction with no runtime dependencies.
- Actively maintained as of 2026-03-03 with stable production status.
License · maintenance · safety
BSD (permissive) — BSD permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
last release 2023-08-22 (1088 days) · last repo commit 2026-03-03 · 218 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 97,160 downloads/mo, #13,165 on PyPI
Alternatives
Verify before relying
pip install fypp
fypp source.fpp source.f90
# Or import the module in Python:
from fypp import fypp
fypp.main()- Whether the package works with Python versions beyond 3.9 (classifiers list up to 3.9 only).
- Current test coverage and CI/CD status to assess stability beyond the active maintenance signal.
What it is and what it does
Fypp is a command-line preprocessor and Python module that extends Fortran with metaprogramming capabilities by interpreting Python expressions embedded in preprocessor directives. It reads Fortran source files annotated with special directives (like #:if, #:for, #:def), evaluates Python logic to conditionally include code or generate templates, and outputs the processed Fortran. The tool integrates into build toolchains as a preprocessing step before compilation.
Instead of inventing its own expression syntax, Fypp leverages Python's full expression language for metaprogramming tasks—defining variables, writing macros, iterating over types to generate overloaded procedures, and inserting dynamic content like timestamps. It handles multiline strings, file inclusion, line numbering directives for debugging, and automatic line folding, making it suitable for large Fortran projects that need code reuse and conditional compilation without leaving the Fortran ecosystem.
Use it for
- Generate type-specific Fortran procedure overloads (e.g., real, complex variants) from a single template definition.
- Conditionally include MPI, OpenMP, or serial code paths based on preprocessor variables set at build time.
- Insert build metadata (timestamps, version strings) or debug assertions into Fortran source during preprocessing.
- Define reusable Fortran macros for common patterns (error checking, array bounds validation) to reduce code duplication.
- Automate boilerplate Fortran code generation for numerical libraries with multiple precision or dimension variants.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Fypp is actively maintained, has no runtime dependencies, installs easily, carries a permissive BSD license, and solves a real problem for Fortran developers needing template metaprogramming and conditional compilation. It is production-stable and suitable for integration into scientific computing and numerical library build pipelines.
Install
fypp on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as of 2026-03-03 with stable production status.
Requires Python 3.5 or above; designed for Fortran development workflows.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install fypp
fypp source.fpp source.f90
# Or import the module in Python:
from fypp import fypp
fypp.main()
Verify before relying
- Whether the package works with Python versions beyond 3.9 (classifiers list up to 3.9 only).
- Current test coverage and CI/CD status to assess stability beyond the active maintenance signal.
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 1,088 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 97,160 / month, #13,165 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Code GeneratorsTopic :: Software Development :: Pre-processors |
Evidence: fypp-3.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fortran preprocessor”
- fyppFypp is a Python-powered preprocessor for Fortran that adds…
- fckitlibProvides Fortran modules and a unit testing framework for building…
- fparserfparser parses Fortran source code (Fortran 77 through 2008) into an…
Give your agent the search over MCP, or paste the wish link into any chat.
More Code Generators packages
Proto Plus wraps protocol buffers to provide Python classes that behave like native Python types while maintaining protocol buffer serialization and schema validation.
Install it if you're working with protocol buffers in Python and want a more Pythonic interface, or if you're using Google Cloud libraries that depend on it.
Cython is a source code translator that compiles Python code to C, enabling optional static typing and direct C/C++ interoperability to generate efficient native extensions.
Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.
Annotates Python abstract syntax trees with the positions of tokens and source code text, enabling tools to map AST nodes back to their originating code for refactoring, analysis, and transformation.
Beartype is a runtime type checker that validates Python type hints at function call time, catching type violations before they cause downstream bugs.
Install it if you want runtime type safety for your annotated code or need to validate type hints on third-party packages.
llvmlite provides a lightweight Python binding to LLVM's IR builder, optimizer, and JIT compiler APIs, enabling you to write JIT compilers and code generators without needing the full LLVM C++ API surface.
astor converts Python abstract syntax trees (ASTs) back to readable source code and provides tools for AST manipulation, inspection, and non-recursive tree traversal.
Install it if you need AST round-tripping or advanced tree inspection.
See also pcpp · fparser · fckitlib · f90nml · intel-openmp · lesscpy · tree-sitter-fortran · asteval · powerfx