Discogs-APY-1.0
توضیحات
A lightweight Python wrapper for the Discogs database API.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | Discogs-APY-1.0 |
| نام | Discogs-APY |
| نسخه کتابخانه | 1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Josh Taylor |
| ایمیل نویسنده | joshvvtaylor@gmail.com |
| آدرس صفحه اصلی | https://github.com/wiperandtrue/Discogs-APY |
| آدرس اینترنتی | https://pypi.org/project/Discogs-APY/ |
| مجوز | MIT Licence |
# Discogs-APY
A lightweight Python wrapper for the Discogs API.
### Usage
Initialise the client using your user token. No support for OAuth yet. Maybe I'll get around to it.
```
client = Discogs-APY.Client(user_token)
```
The client object has Release, Master, Artist, and Label methods. Calling them with a valid discogs ID will return an object of the same name:
```
release = client.release(725292)
Black Holes & Revelations - https://api.discogs.com/releases/725292
```
The object attributes are populated using the json returned from the discogs request.
```
release.artists
[Muse - https://api.discogs.com/artists/1003]
```
Where appropriate, the json data is passed through a database object so that nested endpoints can be accessed using chained dot notation:
```
release.tracklist[0].extraartists[1]
Audrey Riley - https://api.discogs.com/artists/257846
```
Not all attributes are populated with a value. Accessing an attribute with no value will raise a key error.
```
release.members
KeyError: "The 'artist' attribute is not in the json dictionary"
```
نحوه نصب
نصب پکیج whl Discogs-APY-1.0:
pip install Discogs-APY-1.0.whl
نصب پکیج tar.gz Discogs-APY-1.0:
pip install Discogs-APY-1.0.tar.gz