ITunes Library Persistent ID Editor.
Sample usage:
fxml = 'iTunes Music Library.xml' # path to xml file
fitl = 'iTunes Library.itl' # path to itl file
itk = ITunesLibKeys(fxml, fitl)
print itk.file_xml # prints path to xml file
print itk.file_itl # prints path to itl file
print itk.xml_key # prints key on xml
print itk.itl_key # prints key on itl
print itk.valid_key # prints True if keys match
itk.new_user_key() # ask for user input key
itk.xml_key_replace(itk.itl_key) # replace key on xml file with the itl key
itk.itl_key_replace(itk.new_key) # replace key on itl with user input key
fxml = 'iTunes Music Library.xml' # path to xml file
fitl = 'iTunes Library.itl' # path to itl file
itk = ITunesLibKeys(fxml, fitl)
if not itk.valid_key: # if keys don't match
itk.xml_key_replace(itk.itl_key) # replace xml key with the itl key