This is an implementation of the classic topology optimization code described in A 99 line topology optimization code written in Matlab by Ole Sigmund. Start with example.py or example.ipynb.
A more efficient version with more installation requirements can be found under https://github.com/AJJLagerweij/topopt.