Clean up Worldcat author information into a more consistent format.
Worldcat data can be irregularly formatted, unpredictably including
ancillary information. This function attempts to cleans up the author field
into a list of consistent author names.
For example:
>>> parse_authors ("Leonard Richardson and Sam Ruby.")
['Richardson, Leonard', 'Ruby, Sam']
>>> parse_authors ("Ann Thomson.")
['Thomson, Ann']
>>> parse_authors ("Stephen P. Schoenberger, Bali Pulendran, editors.")
['Schoenberger, Stephen P.', 'Pulendran, Bali']
>>> parse_authors ("Madonna")
['Madonna']
- Parameters:
auth_str (string) - The "author" attribute from a Worldcat record in XML.
- Returns:
- A list of the authors in "reverse" format, e.g. "['Smith, A. B.',
'Jones, X. Y.']"
|