Core.rq_collection is a collection of function wrappers around the Discogs API for interacting with a user collection.

get_user_collection_folders[source]

get_user_collection_folders(user:Union[UserWithoutAuthentication, UserWithUserTokenBasedAuthentication], username:str)

Get a list of folders for the given user collection.

Note: If you are not authenticated as the collection owner, only folder ID 0 (the “All” folder) will be visible (if the requested user’s collection is public).

No user Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

# Example for usage of get_user_collection_folders
get_user_collection_folders(user=example_user, 
                            username="discogspy")
<Response [200]>

create_new_user_collection_folder[source]

create_new_user_collection_folder(user:UserWithUserTokenBasedAuthentication, username:str, folder_name:str)

Create a new folder in for the given user collection.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_name: string (required) -> The name of the newly-created folder.

# Example for usage of create_new_user_collection_folder
create_new_user_collection_folder(user=example_user, 
                                  username="discogspy", 
                                  folder_name="new_folder")
<Response [201]>

get_folder_metadata[source]

get_folder_metadata(user:Union[UserWithoutAuthentication, UserWithUserTokenBasedAuthentication], username:str, folder_id:int)

Get metadata about a folder in a user’s collection.

Note: If folder_id is not 0, authentication as the collection owner is required.

No user Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_id: number (required) -> The ID of the folder to request.

# Example for usage of get_folder_metadata
get_folder_metadata(user=example_user, 
                    username="discogspy", 
                    folder_id=1996910)
<Response [200]>

change_collection_folder_name[source]

change_collection_folder_name(user:UserWithUserTokenBasedAuthentication, username:str, folder_id:int, new_folder_name:str)

Change the name of an existing collection folder for the given user collection.

Note: Folders 0 and 1 cannot be renamed.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_id: number (required) -> The ID of the folder to modify.

new_folder_name: string (required) -> The new folder name.

# Example for usage of change_collection_folder_name
change_collection_folder_name(user=example_user, 
                              username="discogspy", 
                              folder_id=1999962, 
                              new_folder_name="new_folder")
<Response [200]>

delete_collection_folder[source]

delete_collection_folder(user:UserWithUserTokenBasedAuthentication, username:str, folder_id:int)

Delete an existing collection folder from the given user collection.

Note: Only possible if folder is empty. Folders 0 and 1 cannot be deleted.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_id: number (required) -> The ID of the folder to delete.

# Example for usage of delete_collection_folder
delete_collection_folder(user=example_user, 
                         username="discogspy", 
                         folder_id=1999962)
<Response [204]>

get_collection_folder_by_release[source]

get_collection_folder_by_release(user:UserWithUserTokenBasedAuthentication, username:str, release_id:int, page:Optional[int]=None, per_page:Optional[int]=None)

Get the user’s collection folders which contain a specified release.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

release_id: number (required) -> The ID of the release to request.

page: number (optional) -> The page you want to request.

per_page: number (optional) -> The number of items per page.

# Example for usage of get_collection_folder_by_release
get_collection_folder_by_release(user=example_user, 
                                 username="discogspy", 
                                 release_id=9093307,
                                 page=1, 
                                 per_page=3)
<Response [200]>

get_collection_items_by_folder[source]

get_collection_items_by_folder(user:Union[UserWithoutAuthentication, UserWithUserTokenBasedAuthentication], username:str, folder_id:int, page:Optional[int]=None, per_page:Optional[int]=None, sort:Optional[SortOptionsCollection]=None, sort_order:Optional[SortOrder]=None)

Get a list of item in a folder from the given user collection.

Note: If folder_id is not 0, or the collection has been made private by its owner, authentication as the collection owner is required.

No user Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_id: number (required) -> The ID of the folder to request.

page: number (optional) -> The page you want to request.

per_page: number (optional) -> The number of items per page.

sort: string (optional) -> Sort items by this field.

sort_order: string (optional) -> Sort items in a particular order (one of asc, desc)

# Example for usage of get_collection_items_by_folder
get_collection_items_by_folder(user=example_user, 
                               username="discogspy", 
                               folder_id=0,
                               page=1, 
                               per_page=3, 
                               sort=SortOptionsCollection.artist, 
                               sort_order=SortOrder.asc)
<Response [200]>

add_release_to_collection_folder[source]

add_release_to_collection_folder(user:UserWithUserTokenBasedAuthentication, username:str, folder_id:int, release_id:int)

Add a release to a folder in the given user collection.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_id: number (required) -> The ID of the folder to request.

release_id: number (required) -> The ID of the release you are adding.

# Example for usage of add_release_to_collection_folder
add_release_to_collection_folder(user=example_user, 
                                 username="discogspy", 
                                 folder_id=1996910, 
                                 release_id=3725617)
<Response [201]>

move_release_to_another_collection_folder[source]

move_release_to_another_collection_folder(user:UserWithUserTokenBasedAuthentication, username:str, source_folder_id:int, destination_folder_id:int, release_id:int, instance_id:int)

Move the instance of an release to another folder.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

source_folder_id: number (required) -> The ID of the source folder.

destination_folder_id: number (required) -> The ID of the destination folder.

release_id: number (required) -> The ID of the release you are modifying.

instance_id: number (required) -> The ID of the instance.

# Example for usage of move_release_to_another_collection_folder
move_release_to_another_collection_folder(user=example_user, 
                                          username="discogspy", 
                                          source_folder_id=1996910, 
                                          destination_folder_id=2002046,
                                          release_id=3725617, 
                                          instance_id=436134425)
<Response [204]>

change_rating_of_release_in_collection_folder[source]

change_rating_of_release_in_collection_folder(user:UserWithUserTokenBasedAuthentication, username:str, folder_id:int, release_id:int, instance_id:int, rating:int)

Change the rating of the instance of an release in the given collection folder.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_id: number (required) -> The ID of the source folder.

folder_id: number (required) -> The ID of the folder to modify.

release_id: number (required) -> The ID of the release you are modifying.

rating: number (required) -> The rating of the instance you are supplying.

# Example for usage of change_rating_of_release_in_collection_folder
change_rating_of_release_in_collection_folder(user=example_user, 
                                              username="discogspy", 
                                              folder_id=2002046,
                                              release_id=3725617, 
                                              instance_id=436134425,
                                              rating=5)
<Response [204]>

delete_release_instance_from_collection_folder[source]

delete_release_instance_from_collection_folder(user:UserWithUserTokenBasedAuthentication, username:str, folder_id:int, release_id:int, instance_id:int)

Remove an instance of a release from a given collection folder.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

folder_id: number (required) -> The ID of the folder to modify.

release_id: number (required) -> The ID of the release you are modifying.

instance_id: number (required) -> The ID of the instance you want to delete.

# Example for usage of delete_release_instance_from_collection_folder
delete_release_instance_from_collection_folder(user=example_user, 
                                               username="discogspy", 
                                               folder_id=2002046,
                                               release_id=3725617, 
                                               instance_id=436134425)
<Response [204]>

list_custom_fields_for_collection_folders[source]

list_custom_fields_for_collection_folders(user:Union[UserWithoutAuthentication, UserWithUserTokenBasedAuthentication], username:str)

Retrieve a list of user-defined collection notes fields. These fields are available on every release in the collection.

Note: If you are not authenticated as the collection owner, only fields with public set to true will be visible.

No user Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

# Example for usage of list_custom_fields_for_collection_folders
list_custom_fields_for_collection_folders(user=example_user, 
                                          username="discogspy")
<Response [200]>

edit_custom_field_value_for_release_instance_from_collection_folder[source]

edit_custom_field_value_for_release_instance_from_collection_folder(user:UserWithUserTokenBasedAuthentication, username:str, value:str, folder_id:int, release_id:int, instance_id:int, field_id:int)

Change the value of a custom field on a particular instance of an release in the given collection folder.

No user Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

value: string (required) -> The new value of the field. If the field’s type is dropdown, the value must match one of the values in the field’s list of options.

folder_id: number (required) -> The ID of the folder to modify.

release_id: number (required) -> he ID of the release you are modifying.

instance_id: number (required) -> The ID of the instance.

field_id: number (required) -> The ID of the field.

# Example for usage of edit_custom_field_value_for_release_instance_from_collection_folder
edit_custom_field_value_for_release_instance_from_collection_folder(user=example_user, 
                                                                    username="discogspy", 
                                                                    value="B", 
                                                                    folder_id=1996875, 
                                                                    release_id=11104152, 
                                                                    instance_id=435423391,
                                                                    field_id=1)
<Response [204]>

get_collection_value[source]

get_collection_value(user:UserWithUserTokenBasedAuthentication, username:str)

Get the minimum, median, and maximum value of a given collection.

User Authentication needed.

Parameters:

user: user object (required)

username: string (required) -> The username of the collection you are trying to retrieve.

# Example for usage of get_collection_value
get_collection_value(user=example_user, 
                     username="discogspy")
<Response [200]>