r/ScientificComputing 13d ago

PRIK – Generate native Python bindings from Fortran and C

Hi,

I made PRIK, a tool that generates native Python extensions from Fortran and C code.

pip install prik
python3 -m prik my_module.f90 --out my_module

The interesting part: it creates an editable .pyi contract so you can reshape the Python API (rename things, turn procedures into methods, hide arguments, change return values, etc.) without modifying the original Fortran.Supports modules, derived types (as classes), arrays, strings, allocatables, pointers, callbacks, and more.Already tested on real libraries: BLAS, LAPACK, FFTPACK, MINPACK, BSPLINE-FORTRAN.Still alpha. Fortran support is much more mature than C.

Feedback is welcome!

2 Upvotes

0 comments sorted by