Skip to content

Instantly share code, notes, and snippets.

@Kazy
Created January 11, 2017 13:43
Show Gist options
  • Save Kazy/4a779d8898c7d36dcdd88a615fc5ffc7 to your computer and use it in GitHub Desktop.
Save Kazy/4a779d8898c7d36dcdd88a615fc5ffc7 to your computer and use it in GitHub Desktop.
from blitzr import BlitzrClient
client = Blitzr(API_KEY)
nin = client.get_artist(slug="nine-inch-nails", extras=["relations"])
print(type(nin["members"]))
# <class 'list'>
slim = client.get_artist(slug="slim-cessnas-auto-club", extras=["relations"])
print(type(slim["members"]))
# <class 'dict'>
# The second one returns a dict like that:
resp = {
'0': {'name': 'Danny Pants',
'slug': 'danny-pants',
'uuid': 'ARVPMPZYTDX1IRqsJ2'},
'1': {'image': 'https://img.blitzr.com/images/artist/ARYPvoojSKMKW7vqDd/ARYPvoojSKMKW7vqDd.jpg',
'name': 'Dwight Pentacost',
'slug': 'dwight-pentacost',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARYPvoojSKMKW7vqDd/ARYPvoojSKMKW7vqDd.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARYPvoojSKMKW7vqDd/ARYPvoojSKMKW7vqDd_300.jpg',
'uuid': 'ARYPvoojSKMKW7vqDd'},
'10': {'image': 'https://img.blitzr.com/images/artist/ARAVkJdhSb1OyK0Hiw/ARAVkJdhSb1OyK0Hiw.jpg',
'name': 'Robert Ferbrache',
'real_name': 'Robert Ferbrache',
'slug': 'robert-ferbrache',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARAVkJdhSb1OyK0Hiw/ARAVkJdhSb1OyK0Hiw.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARAVkJdhSb1OyK0Hiw/ARAVkJdhSb1OyK0Hiw_300.jpg',
'uuid': 'ARAVkJdhSb1OyK0Hiw'},
'11': {'image': 'https://img.blitzr.com/images/artist/ARCCytUwduiOXG6zJQ/ARCCytUwduiOXG6zJQ.jpg',
'name': 'Shane Trost',
'slug': 'shane-trost',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARCCytUwduiOXG6zJQ/ARCCytUwduiOXG6zJQ.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARCCytUwduiOXG6zJQ/ARCCytUwduiOXG6zJQ_300.jpg',
'uuid': 'ARCCytUwduiOXG6zJQ'},
'12': {'image': 'https://img.blitzr.com/images/artist/ARj3zCBtRlotwVEXDt/ARj3zCBtRlotwVEXDt.jpg',
'name': 'Slim Cessna',
'slug': 'slim-cessna',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARj3zCBtRlotwVEXDt/ARj3zCBtRlotwVEXDt.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARj3zCBtRlotwVEXDt/ARj3zCBtRlotwVEXDt_300.jpg',
'uuid': 'ARj3zCBtRlotwVEXDt'},
'14': {'name': 'Tim Maher', 'slug': 'tim-maher', 'uuid': 'ARTshgJBllMo6JiSLn'},
'15': {'name': 'Todd Peeler Moore',
'slug': 'todd-peeler-moore',
'uuid': 'ARKFKifID12MDDqcjc'},
'16': {'name': 'Whiff Cessna',
'slug': 'whiff-cessna',
'uuid': 'AR6KA6cywc9N1S2vCn'},
'2': {'name': 'Frank Hauser Jr.',
'slug': 'frank-hauser-jr',
'uuid': 'AR5oDDVnXts7F3D8m3'},
'3': {'name': "Ian O'Dougherty",
'slug': 'ian-odougherty',
'uuid': 'ARJB5guMxVRqpNHFL9'},
'4': {'image': 'https://img.blitzr.com/images/artist/ARQa6oC5p3NfuGPrqf/ARQa6oC5p3NfuGPrqf.jpg',
'name': 'Jay Munly',
'real_name': 'Jay Munly',
'slug': 'jay-munly',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARQa6oC5p3NfuGPrqf/ARQa6oC5p3NfuGPrqf.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARQa6oC5p3NfuGPrqf/ARQa6oC5p3NfuGPrqf_300.jpg',
'uuid': 'ARQa6oC5p3NfuGPrqf'},
'5': {'image': 'https://img.blitzr.com/images/artist/ARqeWOIS3gJt14dP1L/ARqeWOIS3gJt14dP1L.jpg',
'name': 'John Rumley',
'slug': 'john-rumley',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARqeWOIS3gJt14dP1L/ARqeWOIS3gJt14dP1L.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARqeWOIS3gJt14dP1L/ARqeWOIS3gJt14dP1L_300.jpg',
'uuid': 'ARqeWOIS3gJt14dP1L'},
'6': {'name': 'Judithann', 'slug': 'judithann', 'uuid': 'ARjxYhSurU1wpduIw4'},
'7': {'image': 'https://img.blitzr.com/images/artist/ARE540tWHKiIi8dpn1/ARE540tWHKiIi8dpn1.jpg',
'name': 'Ordy Garrison',
'slug': 'ordy-garrison',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARE540tWHKiIi8dpn1/ARE540tWHKiIi8dpn1.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARE540tWHKiIi8dpn1/ARE540tWHKiIi8dpn1_300.jpg',
'uuid': 'ARE540tWHKiIi8dpn1'},
'8': {'image': 'https://img.blitzr.com/images/artist/ARm6dPIWYFRUz6cPkF/ARm6dPIWYFRUz6cPkF.jpg',
'name': 'Rebecca Vera',
'slug': 'rebecca-vera',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARm6dPIWYFRUz6cPkF/ARm6dPIWYFRUz6cPkF.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARm6dPIWYFRUz6cPkF/ARm6dPIWYFRUz6cPkF_300.jpg',
'uuid': 'ARm6dPIWYFRUz6cPkF'},
'9': {'image': 'https://img.blitzr.com/images/artist/ARMtRoUQgU4UBBprVr/ARMtRoUQgU4UBBprVr.jpg',
'name': 'Reverend Glasseye',
'slug': 'reverend-glasseye',
'thumb': 'https://img.blitzr.com/thumbnails/artist/ARMtRoUQgU4UBBprVr/ARMtRoUQgU4UBBprVr.jpg',
'thumb_300': 'https://img.blitzr.com/images/artist/ARMtRoUQgU4UBBprVr/ARMtRoUQgU4UBBprVr_300.jpg',
'uuid': 'ARMtRoUQgU4UBBprVr'}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment