I stumbled on a bug that’s already been reported:
and signed as fixed (from almost 3 years) but apparently in my case the class NETINFO_ITEM is still not usable trough Python:
import pcbnew
board = pcbnew.GetBoard()
net = NETINFO_ITEM(board, "NEWNET")
Traceback (most recent call last): File "<input>", line 1, in <module>
NameError: name 'NETINFO_ITEM' is not defined
Someone else tried this? I’m running KiCAD 5.1.4 on Windows 10 Pro