Skip to main content

A lightweight Python wrapper for the Discogs database API.

Project description

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"

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

Discogs-APY-1.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file Discogs-APY-1.0.tar.gz.

File metadata

  • Download URL: Discogs-APY-1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for Discogs-APY-1.0.tar.gz
Algorithm Hash digest
SHA256 a875e6553650d7b1f4a7461d94ed0e2123f191ed3d91bbd55075e4fe7177dbce
MD5 2d7611c647dd251739bbe4708820ff2c
BLAKE2b-256 93d473ef1fa8577ff19305a85d0d4caaf1c8cd7b3286174aa2800aac7b244d6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page