将书籍作者分类为小说与非小说
出于我个人的目的,我有大约 300 名各种书籍的作者(全名)。我想将此列表分为“小说作者”和“非小说作者”。如果作者同时写了这两篇文章,那么大多数人都会获得投票权。
我查看了 Amazon Product Search API:我可以按作者搜索(in Python),但无法找到图书类别(小说与其他):
>>> node = api.item_search('Books', Author='Richard Dawkins')
>>> for book in node.Items.Item:
... print book.ItemAttributes.Title
我有什么选择?我更喜欢用 Python 来做这件事。
For my own personal purposes, I have about ~300 authors (full name) of various books. I want to partition this list into "fiction authors" and "non-fiction authors". If an author writes both, then the majority gets the vote.
I looked at Amazon Product Search API: I can search by author (in Python), but there is no way to find the book category (fiction vs rest):
>>> node = api.item_search('Books', Author='Richard Dawkins')
>>> for book in node.Items.Item:
... print book.ItemAttributes.Title
What are my options? I prefer to do this in Python.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,您可以尝试其他服务 - Google 图书搜索 API。要使用 Python,您可以查看 gdata-python-api。在其协议中,结果提要中有一个节点
- 可能 这就是您所需要的:当然,此协议为您提供了一些与本书相关的开销信息(例如在 Google 图书上是否可见等)
Well, you can try another service - Google Book Search API. To use Python you can have a look at gdata-python-api. In its protocol, in result feed there is a node
<dc:subject>
- probably that's what you need:Of course, this protocol gives you some overhead information, related to this book (like visible or not on Google Books etc.)
您查看过
BrowseNodes
吗?对我(之前没有使用过这个 API)来说,BrowseNodes
似乎对应于亚马逊的产品类别。也许您可以在那里找到更多信息。Did you look at
BrowseNodes
? To me (who has not been using this API before) it seemsBrowseNodes
correspond to Amazon's product categories. Maybe you find more information there.在花了一些时间搞乱 Amazon API 后,看起来他们没有提供您想要的信息。
他们在文档中没有提及该类型的类别,并且如果您序列化 api 发送给您的内容,则不会提及小说或非小说类别。
您可以使用它打印出一个漂亮的 XML 字符串(您可能希望将其定向到一个文件以便于阅读)以及 api 发送的所有内容。
After spending some time messing with the Amazon API it looks like they don't provide the kind of information you want.
They don't mention categories of that type in their documentation and if you serialise the stuff the api sends you there is not a single mention of fiction or non-fiction catergories.
You can use this to print out a nice XML string (you might want to direct it at a file for easy reading) with all of the stuff the api sends.