This post demonstrates how to access and manipulate genepools using GHPython, and should get you started: