-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
96 lines (68 loc) · 2.6 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
pitchfork-api
=============
An unofficial python API for
`pitchfork.com <http://www.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 <https://pypi.python.org/pypi>`__:
.. code:: sh
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 !!!
.. code:: sh
git clone https://github.com/tejassharma96/pitchfork_api
Usage
-----
.. code:: python
>> 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()
best_new_music()
editorial()
full_text()
cover()
artist()
album()
label()
year()
Tests
-----
You can run the basic tests located in the ``tests`` directory with:
.. code:: sh
$ 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!
.. |Build Status| image:: https://travis-ci.org/tejassharma96/pitchfork_api.svg?branch=master
:target: https://travis-ci.org/tejassharma96/pitchfork_api
.. |Latest Version| image:: https://pypip.in/v/pitchfork-api/badge.png
:target: https://pypi.python.org/pypi/pitchfork-api/
.. |Py Versions| image:: https://img.shields.io/pypi/pyversions/pitchfork-api.svg?maxAge=2592000
:target: https://img.shields.io/pypi/pyversions/