def make_bookdict(bkinfo, publisher_addresses=None):
	from collections import defaultdict
	import difflib
	if publisher_addresses is None:
		publisher_addresses = PUBLISHER_ADDRESSES
	bd = defaultdict(str)
	try:
		author = bkinfo.Author.strip()
		author_last = author.split()[-1].lower()
	except AttributeError:
		author = "unknown"
		author_last = "unknown"
	try:
		date = bkinfo.PublicationDate.strip().split()[-1]
		year = date.strip().split('-')[0]
	except AttributeError:
		date = "unknown"
		year = "unknown"
	bd['citekey'] = (author_last,date)%"%s-%s"
	bd['author'] = author
	bd['date'] = date
	bd['year'] = year
	bd['title'] = bkinfo.Title
	bd['isbn'] = bkinfo.ISBN
	publisher = bkinfo.Manufacturer.strip() #?att name??
	bd['publisher'] = publisher
	#thanks to Greg Pinero for nicer address matching:
	best_pub_matches = difflib.get_close_matches(publisher,publisher_addresses.keys(),1)
	if best_pub_matches:
		bd['address'] = publisher_addresses[best_pub_matches[0]]	   
	return bd


# some test ISBNs:
dataset/ETHPy150Open dschwilk/bibstuff/bibstuff/isbn2bib.py/make_bookdict/swapped operands of `%`