Added python interface for nchain extraction