A versatile, template-based Fortran wrapper written in Python.
F2x is a Python tool that allows you to take your Fortran code and make it accessible from other languages (mainly Python). Compared to the popular tool f2py it comes with two important differences:
- A full Fortran parser based on the work by the OpenFortranParser
- A very flexible code generation backend that uses Jinja2 templates
To install the latest version of F2x, you can use the following commands:
git clone https://github.com/DLR-SC/F2x.git
cd F2x
python setup.py install --user
(Note the--user
flag to allow installation without admin rights.)F2x --help
(Confirms installation of F2x.)
Please refer to the documentation to find more infomation about getting started.
F2x reuses a lot of stuff from other Open Source projects. Namely the following parts were really helpful:
- It is developed in Python 3 and does currently not support Python 2 out of the box.
- The PLY project is used as parser generator. PlyPlus does the heavy lifiting of converting ANTLR-like grammars to PLY.
- The Fortran grammar that comes bundled with F2x originates from the OpenFortranProject.
- Templates are based on Jinja2.
Copyright 2018 German Aerospace Center (DLR)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.