Refactor the Python identifiers update script for better flexibility