I did this as portfolio project for CS102. Check it out if you will. There is no AI for heroes, but there are for enemy units on map.
HoMM Terminal Edition v0.5 (beta2).zip - pCloud , py files included. For instant play on Windows and macOS using pyinstaller module.
My GitHub, that also has the py files if you’d rather run it yourself:
Let me know if you like it.