Pitchfork.com评论的非正式API
pitchfork的Python项目详细描述
用于 pitchfork.com评论。
Build Status | Version | Downloads (30 days) |
---|---|---|
安装
你可以从python package index:
pip install pitchfork
您也可以克隆存储库,但请注意pitchfork依赖于 在beautifulsoup4上进行HTML解析,因此必须首先安装 beautifulsoup4你自己!!!
git clone https://github.com/michalczaplinski/pitchfork.git
用法
>>importpitchfork>>p=pitchfork.search('kanye west','my beautiful')# the title is autocompleted>>p.album()# the full album titleu'My Beautiful Dark Twisted Fantasy'>>p.label()u'Def Jam / Roc-A-Fella'>>p.editorial()[:100]# get the first 100 characters of the review.u"Kanye West's 35-minute super-video,\xa0Runaway, peaks with a parade. Fireworks flash while red hoods ma"# the link to the album cover image>>p.cover()'http://cdn4.pitchfork.com/albums/15935/homepage_large.831179e9.jpg'>>p.score()10.0# pretty overrated IMHO!
测试
您可以使用以下命令运行位于tests目录中的基本测试:
$ cd pitchfork
$ python3 -m unittest discover
许可证
麻省理工学院
贡献
如果你想增加一些新的功能,建议改进或其他什么 欢迎给我留言或发送请求!