Skip to main content

Unofficial API for pitchfork.com reviews, maintained version of pitchfork

Project description

An unofficial python API for pitchfork.com reviews.

Build Status Version Python Versions
Build Status Latest Version Py Versions

Apologies for the confusing naming - pypi doesn’t allow the use of underscores in package names, while python doesn’t allow dashes in module names. As a result, the package name is pitchfork-api, but it is pitchfork_api everywhere else.

Installation

You can get it from python package index:

pip install pitchfork-api

You can also clone the repository, but note that pitchfork depends on beautifulsoup4 for HTML parsing so you first have to install beautifulsoup4 yourself !!!

git clone https://github.com/tejassharma96/pitchfork_api

Usage

>> import pitchfork

>> p = pitchfork.search('kanye west', 'my beautiful') # the title is autocompleted
>> p.album() # the full album title
u'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

# to check what methods are available, you can use 'methods()'
>> p.methods()
score()
abstract()
editorial()
full_text()
cover()
artist()
album()
label()
year()

Tests

You can run the basic tests located in the tests directory with:

$ cd pitchfork
$ python3 -m unittest discover

License

MIT

Contributions

If you want to add some new feature, suggest improvement or whatnot you’re welcome to message me or send a pull request!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pitchfork-api, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size pitchfork_api-0.0.4-py3-none-any.whl (10.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pitchfork_api-0.0.4.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page