pyFEMM is a Python interface to Finite Element Method Magnetics (FEMM). The module uses win32com to communicate with FEMM's out-of-proc activex server. The functions in the module wrap interactions with FEMM, making it easy to script FEMM from a Python program.
FEMM is available from the Download page.
The pyFEMM package is available for download here or from PyPI.
Documentation is available at https://www.femm.info/wiki/pyFEMM/manual.pdf
Versions: v0.1.3, 20Jul2021
v0.1.1, 11May2020 Bug fix update.
ci_smartmesh, mi_smartmesh, ei_smartmesh, and hi_smartmesh functionsmo_showcontourplot v0.1.0, 17Mar2018 Initial release.
Several examples show how to use Python to do scripting with FEMM. Most of these examples are presented in Matlab, Mathematica, and Scilab formats in the examples directory of the FEMM distribution.
Coilgun.zip contains a Python script and a FEMM model for the problem discussed on the CoilGun page. The Python script is a port of the original Lua version. The Matplotlib package is used to make a Matlab-like plot of the resulting forces projectile.
Figure 1: Plot of force on projectile created by coilgun.py using the Matplotlib package.
Demo2.py builds a coil with an iron core and plots flux density in the core.
strips.py computes the capacitance of coupled microstrip lines.
htutor.py computes the heat flow through a rectangular chimney.
ACElec2.py
Cylindrical capacitor as described here.
roters1.zip is the same as RotersExample but with a 0.8A coil current.

Phase3.py models a three-phase power line in an unbounded region carrying balanced currents. The script returns the per-meter impedance of each line:
The per-meter 60Hz impedance of each line is 3.807e-05+0.0001629j Ohms