python - Categorize book authors as fiction vs non-fiction -


for own personal purposes, have ~300 authors (full name) of various books. want partition list "fiction authors" , "non-fiction authors". if author writes both, majority gets vote.

i looked @ amazon product search api: can search author (in python), there no way find book category (fiction vs rest):

>>> node = api.item_search('books', author='richard dawkins') >>> book in node.items.item: ...     print book.itemattributes.title 

what options? prefer in python.

well, can try service - google book search api. use python can have @ gdata-python-api. in protocol, in result feed there node <dc:subject> - that's need:

<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/atom"       xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/"       xmlns:gbs="http://schemas.google.com/books/2008"        xmlns:dc="http://purl.org/dc/terms"       xmlns:gd="http://schemas.google.com/g/2005">   <id>http://www.google.com/books/feeds/volumes</id>   <updated>2008-08-12t23:25:35.000</updated>  <!--  loot of information here, removed nodes save space.. -->      <dc:creator>jane austen</dc:creator>     <dc:creator>james kinsley</dc:creator>     <dc:creator>fiona stafford</dc:creator>     <dc:date>2004</dc:date>     <dc:description>       if truth universally acknowledged can shrink quite rapidly        opinion of obsessive comic character, reader may reasonably feel ...     </dc:description>     <dc:format>382</dc:format>     <dc:identifier>8cp-z_g42g4c</dc:identifier>     <dc:identifier>isbn:0192802380</dc:identifier>     <dc:publisher>oxford university press, usa</dc:publisher>     <dc:subject>fiction</dc:subject>     <dc:title>pride , prejudice</dc:title>     <dc:title>a novel</dc:title>   </entry> </feed> 

of course, protocol gives overhead information, related book (like visible or not on google books etc.)


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -