I would suggest using a wrapper module like the one here:
The library itself is an ongoing project of mine about pruning and calculating saliencies.