pep8 example code
[CI skip]
This commit is contained in:
parent
b747916147
commit
eff3f882f6
10
README.md
10
README.md
|
@ -44,15 +44,15 @@ import pylast
|
||||||
|
|
||||||
# You have to have your own unique two values for API_KEY and API_SECRET
|
# You have to have your own unique two values for API_KEY and API_SECRET
|
||||||
# Obtain yours from http://www.last.fm/api/account/create for Last.fm
|
# Obtain yours from http://www.last.fm/api/account/create for Last.fm
|
||||||
API_KEY = "b25b959554ed76058ac220b7b2e0a026" # this is a sample key
|
API_KEY = "b25b959554ed76058ac220b7b2e0a026" # this is a sample key
|
||||||
API_SECRET = "425b55975eed76058ac220b7b4e8a054"
|
API_SECRET = "425b55975eed76058ac220b7b4e8a054"
|
||||||
|
|
||||||
# In order to perform a write operation you need to authenticate yourself
|
# In order to perform a write operation you need to authenticate yourself
|
||||||
username = "your_user_name"
|
username = "your_user_name"
|
||||||
password_hash = pylast.md5("your_password")
|
password_hash = pylast.md5("your_password")
|
||||||
|
|
||||||
network = pylast.LastFMNetwork(api_key = API_KEY, api_secret =
|
network = pylast.LastFMNetwork(api_key=API_KEY, api_secret=API_SECRET,
|
||||||
API_SECRET, username = username, password_hash = password_hash)
|
username=username, password_hash=password_hash)
|
||||||
|
|
||||||
# Now you can use that object everywhere
|
# Now you can use that object everywhere
|
||||||
artist = network.get_artist("System of a Down")
|
artist = network.get_artist("System of a Down")
|
||||||
|
@ -63,8 +63,8 @@ track = network.get_track("Iron Maiden", "The Nomad")
|
||||||
track.love()
|
track.love()
|
||||||
track.add_tags(("awesome", "favorite"))
|
track.add_tags(("awesome", "favorite"))
|
||||||
|
|
||||||
# Type help(pylast.LastFMNetwork) or help(pylast) in a Python interpreter to get more help
|
# Type help(pylast.LastFMNetwork) or help(pylast) in a Python interpreter
|
||||||
# about anything and see examples of how it works
|
# to get more help about anything and see examples of how it works
|
||||||
```
|
```
|
||||||
|
|
||||||
More examples in <a href="https://github.com/hugovk/lastfm-tools">hugovk/lastfm-tools</a> and [test_pylast.py](test_pylast.py).
|
More examples in <a href="https://github.com/hugovk/lastfm-tools">hugovk/lastfm-tools</a> and [test_pylast.py](test_pylast.py).
|
||||||
|
|
Loading…
Reference in a new issue