Transpiler from Python to Fortran A developer built a transpiler that converts numerical Python, NumPy, pandas, and partial SciPy code into Fortran using Codex and Claude Code, with some translations running 10-100 times faster and a geometric mean speedup of 2x across John Burkardt's Python programs. The transpiler infers scalar, array, string, and pandas DataFrame cases, emits Fortran source, optionally compiles it with gfortran, and compares Python and Fortran output for regression testing; a prime-counting example translated to Fortran ran about 20 times faster. The tool also handles the NumPy examples from the Python Fortran Rosetta Stone, and xp2f_fpm.py can package several drivers with a shared stateless Python module into an FPM project. Using Codex and Claude Code I have created a Python, NumPy, pandas, and partial SciPy to Fortran transpiler. It is intended for numerical Python programs that use a Fortran-friendly subset of Python. It can infer many scalar, array, string, and pandas DataFrame cases, emit Fortran source, optionally compile it with gfortran , and compare Python and Fortran output for regression testing. I have tested it on the Python programs of John Burkardt, and some of the Fortran translations are 10-100 times faster https://github.com/Beliavsky/Python-to-Fortran/blob/main/TIMING RESULTS.md , with a geometric mean speed up of 2x. The translation of python """Count primes up to n""" def is prime n : if n < 2: return False if n == 2: return True if n % 2 == 0: return False d = 3 while d d <= n: if n % d == 0: return False d += 2 return True limit = 10 6 nprime = 0 max prime = None for n in range 2, limit + 1 : if is prime n : nprime += 1 max prime = n print "number of primes =", nprime print "largest prime =", max prime to Fortran module xprime proc mod use, intrinsic :: iso fortran env, only: real64 implicit none private integer, parameter :: dp = real64 public :: dp, is prime contains pure elemental function is prime n result func res integer, intent in :: n logical :: func res integer :: d if n < 2 then func res = .false. return end if if n == 2 then func res = .true. return end if if modulo n, 2 == 0 then func res = .false. return end if d = 3 do while d d <= n if modulo n, d == 0 then func res = .false. return end if d = d + 2 end do func res = .true. end function is prime end module xprime proc mod program xprime use xprime proc mod, only: is prime implicit none integer, parameter :: limit = 10 6 constant from python source integer :: max prime, n, nprime nprime = 0 max prime = -1 do n = 2, limit if is prime n then nprime = nprime + 1 max prime = n end if end do print , "number of primes =", nprime print , "largest prime =", max prime end program xprime is about 20 times faster. It translates the NumPy examples from Python Fortran Rosetta Stone — Fortran Programming Language https://fortran-lang.org/learn/rosetta stone/ . xp2f fpm.py can package several drivers with a shared stateless Python module into an FPM project https://fpm.fortran-lang.org/spec/manifest.html .