diff --git a/discogs_client/models.py b/discogs_client/models.py index f335495..e23ea88 100644 --- a/discogs_client/models.py +++ b/discogs_client/models.py @@ -457,18 +457,27 @@ def _transform(self, item): class Artist(PrimaryAPIObject): - id = SimpleField() - name = SimpleField() - real_name = SimpleField(key='realname') - images = SimpleField() - profile = SimpleField() - data_quality = SimpleField() - name_variations = SimpleField(key='namevariations') - url = SimpleField(key='uri') - urls = SimpleField() - aliases = ListField('Artist') - members = ListField('Artist') - groups = ListField('Artist') + """An object describing an artist""" + id = SimpleField() #: + name = SimpleField() #: + real_name = SimpleField(key='realname') #: + images = SimpleField() #: + profile = SimpleField() #: + data_quality = SimpleField() #: + name_variations = SimpleField(key='namevariations') #: + url = SimpleField(key='uri') #: + urls = SimpleField() #: + aliases = ListField('Artist') #: + members = ListField('Artist') #: + groups = ListField('Artist') #: + #: This attribute is only populated when an ``Artist`` object is requested + #: via the ``artists`` list of a ``Release`` object, and if it is a + #: multi-artist release. Usually only the first ``Artist`` object in the + #: ``artists`` list contains a keyword such as "And", "Feat", "Vs", or + #: similar. This keyword could be used to combine artists together into a + #: single string, for example: "DJ ABC Feat MC Z". Also check out the + #: ``artists_sort`` attribute of a ``Release`` object. + join = SimpleField() def __init__(self, client, dict_): super(Artist, self).__init__(client, dict_) @@ -544,9 +553,9 @@ def __repr__(self): class MarketplaceStats(PrimaryAPIObject): - num_for_sale = SimpleField() - blocked_from_sale = SimpleField() - lowest_price = ObjectField('Price') + num_for_sale = SimpleField() #: + blocked_from_sale = SimpleField() #: + lowest_price = ObjectField('Price') #: def __init__(self, client, dict_): super(MarketplaceStats, self).__init__(client, dict_) @@ -557,14 +566,14 @@ def __repr__(self): class PriceSuggestions(PrimaryAPIObject): - very_good = ObjectField("Price", key="Very Good (VG)") - good_plus = ObjectField("Price", key="Good Plus (G+)") - near_mint = ObjectField("Price", key="Near Mint (NM or M-)") - good = ObjectField("Price", key="Good (G)") - very_good_plus = ObjectField("Price", key="Very Good Plus (VG+)") - mint = ObjectField("Price", key="Mint (M)") - fair = ObjectField("Price", key="Fair (F)") - poor = ObjectField("Price", key="Poor (P)") + very_good = ObjectField("Price", key="Very Good (VG)") #: + good_plus = ObjectField("Price", key="Good Plus (G+)") #: + near_mint = ObjectField("Price", key="Near Mint (NM or M-)") #: + good = ObjectField("Price", key="Good (G)") #: + very_good_plus = ObjectField("Price", key="Very Good Plus (VG+)") #: + mint = ObjectField("Price", key="Mint (M)") #: + fair = ObjectField("Price", key="Fair (F)") #: + poor = ObjectField("Price", key="Poor (P)") #: def __init__(self, client, dict_): super(PriceSuggestions, self).__init__(client, dict_) @@ -575,18 +584,18 @@ def __repr__(self) -> str: class Master(PrimaryAPIObject): - id = SimpleField() - title = SimpleField() - data_quality = SimpleField() - styles = SimpleField() - year = SimpleField() - genres = SimpleField() - images = SimpleField() - url = SimpleField(key='uri') - videos = ListField('Video') - tracklist = ListField('Track') - main_release = ObjectField('Release', as_id=True) - versions = ObjectCollection('Release') + id = SimpleField() #: + title = SimpleField() #: + data_quality = SimpleField() #: + styles = SimpleField() #: + year = SimpleField() #: + genres = SimpleField() #: + images = SimpleField() #: + url = SimpleField(key='uri') #: + videos = ListField('Video') #: + tracklist = ListField('Track') #: + main_release = ObjectField('Release', as_id=True) #: + versions = ObjectCollection('Release') #: def __init__(self, client, dict_): super(Master, self).__init__(client, dict_) @@ -597,17 +606,17 @@ def __repr__(self): class Label(PrimaryAPIObject): - id = SimpleField() - name = SimpleField() - profile = SimpleField() - urls = SimpleField() - images = SimpleField() - contact_info = SimpleField() - data_quality = SimpleField() - url = SimpleField(key='uri') - sublabels = ListField('Label') - parent_label = ObjectField('Label', optional=True) - releases = ObjectCollection('Release') + id = SimpleField() #: + name = SimpleField() #: + profile = SimpleField() #: + urls = SimpleField() #: + images = SimpleField() #: + contact_info = SimpleField() #: + data_quality = SimpleField() #: + url = SimpleField(key='uri') #: + sublabels = ListField('Label') #: + parent_label = ObjectField('Label', optional=True) #: + releases = ObjectCollection('Release') #: def __init__(self, client, dict_): super(Label, self).__init__(client, dict_) @@ -618,22 +627,22 @@ def __repr__(self): class User(PrimaryAPIObject): - id = SimpleField() - username = SimpleField() - releases_contributed = SimpleField() - num_collection = SimpleField() - num_wantlist = SimpleField() - num_lists = SimpleField() - rank = SimpleField() - rating_avg = SimpleField() - url = SimpleField(key='uri') - name = SimpleField(writable=True) - profile = SimpleField(writable=True) - location = SimpleField(writable=True) - home_page = SimpleField(writable=True) - registered = SimpleField(transform=parse_timestamp) - inventory = ObjectCollection('Listing', key='listings', url_key='inventory_url', list_class=Inventory) - wantlist = ObjectCollection('WantlistItem', key='wants', url_key='wantlist_url', list_class=Wantlist) + id = SimpleField() #: + username = SimpleField() #: + releases_contributed = SimpleField() #: + num_collection = SimpleField() #: + num_wantlist = SimpleField() #: + num_lists = SimpleField() #: + rank = SimpleField() #: + rating_avg = SimpleField() #: + url = SimpleField(key='uri') #: + name = SimpleField(writable=True) #: + profile = SimpleField(writable=True) #: + location = SimpleField(writable=True) #: + home_page = SimpleField(writable=True) #: + registered = SimpleField(transform=parse_timestamp) #: + inventory = ObjectCollection('Listing', key='listings', url_key='inventory_url', list_class=Inventory) #: + wantlist = ObjectCollection('WantlistItem', key='wants', url_key='wantlist_url', list_class=Wantlist) #: def __init__(self, client, dict_): super(User, self).__init__(client, dict_) @@ -678,11 +687,11 @@ def __repr__(self): class WantlistItem(PrimaryAPIObject): - id = SimpleField() - rating = SimpleField(writable=True) - notes = SimpleField(writable=True) - notes_public = SimpleField(writable=True) - release = ObjectField('Release', key='basic_information') + id = SimpleField() #: + rating = SimpleField(writable=True) #: + notes = SimpleField(writable=True) #: + notes_public = SimpleField(writable=True) #: + release = ObjectField('Release', key='basic_information') #: def __init__(self, client, dict_): super(WantlistItem, self).__init__(client, dict_) @@ -694,13 +703,13 @@ def __repr__(self): # TODO: folder_id should be a Folder object; needs folder_url # TODO: notes should be first-order (somehow); needs resource_url class CollectionItemInstance(PrimaryAPIObject): - id = SimpleField() - instance_id = SimpleField() - rating = SimpleField() - folder_id = SimpleField() - notes = SimpleField() - date_added = SimpleField(transform=parse_timestamp) - release = ObjectField('Release', key='basic_information') + id = SimpleField() #: + instance_id = SimpleField() #: + rating = SimpleField() #: + folder_id = SimpleField() #: + notes = SimpleField() #: + date_added = SimpleField(transform=parse_timestamp) #: + release = ObjectField('Release', key='basic_information') #: def __init__(self, client, dict_): super(CollectionItemInstance, self).__init__(client, dict_) @@ -710,9 +719,9 @@ def __repr__(self): class CollectionValue(PrimaryAPIObject): - maximum = SimpleField() - median = SimpleField() - minimum = SimpleField() + maximum = SimpleField() #: + median = SimpleField() #: + minimum = SimpleField() #: def __init__(self, client, dict_): super(CollectionValue, self).__init__(client, dict_) @@ -722,9 +731,9 @@ def __repr__(self): class CollectionFolder(PrimaryAPIObject): - id = SimpleField() - name = SimpleField() - count = SimpleField() + id = SimpleField() #: + name = SimpleField() #: + count = SimpleField() #: def __init__(self, client, dict_): super(CollectionFolder, self).__init__(client, dict_) @@ -750,14 +759,14 @@ def __repr__(self): class List(PrimaryAPIObject): - id = SimpleField() - name = SimpleField() - description = SimpleField() - public = SimpleField() - url = SimpleField(key='uri') - date_changed = SimpleField(transform=parse_timestamp) - date_added = SimpleField(transform=parse_timestamp) - items = ListField('ListItem') + id = SimpleField() #: + name = SimpleField() #: + description = SimpleField() #: + public = SimpleField() #: + url = SimpleField(key='uri') #: + date_changed = SimpleField(transform=parse_timestamp) #: + date_added = SimpleField(transform=parse_timestamp) #: + items = ListField('ListItem') #: def __init__(self, client, dict_): super(List, self).__init__(client, dict_) @@ -768,22 +777,22 @@ def __repr__(self): class Listing(PrimaryAPIObject): - id = SimpleField() - status = SimpleField(writable=True) - allow_offers = SimpleField(writable=True) - condition = SimpleField(writable=True) - sleeve_condition = SimpleField(writable=True) - ships_from = SimpleField() - comments = SimpleField(writable=True) - audio = SimpleField() - url = SimpleField(key='uri') - release = ObjectField('Release') - seller = ObjectField('User') - posted = SimpleField(transform=parse_timestamp) - weight = SimpleField(writable=True) - location = SimpleField(writable=True) - format_quantity = SimpleField(writable=True) - external_id = SimpleField(writable=True) + id = SimpleField() #: + status = SimpleField(writable=True) #: + allow_offers = SimpleField(writable=True) #: + condition = SimpleField(writable=True) #: + sleeve_condition = SimpleField(writable=True) #: + ships_from = SimpleField() #: + comments = SimpleField(writable=True) #: + audio = SimpleField() #: + url = SimpleField(key='uri') #: + release = ObjectField('Release') #: + seller = ObjectField('User') #: + posted = SimpleField(transform=parse_timestamp) #: + weight = SimpleField(writable=True) #: + location = SimpleField(writable=True) #: + format_quantity = SimpleField(writable=True) #: + external_id = SimpleField(writable=True) #: def __init__(self, client, dict_): super(Listing, self).__init__(client, dict_) @@ -808,19 +817,19 @@ def __repr__(self): class Order(PrimaryAPIObject): - id = SimpleField() - next_status = SimpleField() - shipping_address = SimpleField() - additional_instructions = SimpleField() - url = SimpleField(key='uri') - status = SimpleField(writable=True) - fee = ObjectField('Price') - buyer = ObjectField('User') - seller = ObjectField('User') - created = SimpleField(transform=parse_timestamp) - last_activity = SimpleField(transform=parse_timestamp) - messages = ObjectCollection('OrderMessage', list_class=OrderMessagesList) - items = ListField('Listing') + id = SimpleField() #: + next_status = SimpleField() #: + shipping_address = SimpleField() #: + additional_instructions = SimpleField() #: + url = SimpleField(key='uri') #: + status = SimpleField(writable=True) #: + fee = ObjectField('Price') #: + buyer = ObjectField('User') #: + seller = ObjectField('User') #: + created = SimpleField(transform=parse_timestamp) #: + last_activity = SimpleField(transform=parse_timestamp) #: + messages = ObjectCollection('OrderMessage', list_class=OrderMessagesList) #: + items = ListField('Listing') #: def __init__(self, client, dict_): super(Order, self).__init__(client, dict_) @@ -841,53 +850,53 @@ def __repr__(self): class OrderMessage(SecondaryAPIObject): - subject = SimpleField() - message = SimpleField() - to = ObjectField('User') - order = ObjectField('Order') - timestamp = SimpleField(transform=parse_timestamp) + subject = SimpleField() #: + message = SimpleField() #: + to = ObjectField('User') #: + order = ObjectField('Order') #: + timestamp = SimpleField(transform=parse_timestamp) #: def __repr__(self): return ''.format(self.to.username) class Track(SecondaryAPIObject): - duration = SimpleField() - position = SimpleField() - title = SimpleField() - artists = ListField('Artist') - credits = ListField('Artist', key='extraartists') + duration = SimpleField() #: + position = SimpleField() #: + title = SimpleField() #: + artists = ListField('Artist') #: FIXME could an artist in this list contain the "join" field as well? + credits = ListField('Artist', key='extraartists') #: def __repr__(self): return ''.format(self.position, self.title) class Price(SecondaryAPIObject): - currency = SimpleField() - value = SimpleField() + currency = SimpleField() #: + value = SimpleField() #: def __repr__(self): return ''.format(self.value, self.currency) class Video(SecondaryAPIObject): - duration = SimpleField() - embed = SimpleField() - title = SimpleField() - description = SimpleField() - url = SimpleField(key='uri') + duration = SimpleField() #: + embed = SimpleField() #: + title = SimpleField() #: + description = SimpleField() #: + url = SimpleField(key='uri') #: def __repr__(self): return '