python libaray for encoder