show_metadata shows all metadata including sort values. If you want to use the algorithm for values not in the databse, then you can do so via calibre-debug
Code:
calibre-debug -c "from calibre.ebooks.metadata import *; import sys; print(author_to_author_sort(' '.join(sys.argv[1:])))" Kovid Goyal