Load IAM datasets using mirdata

compIAM includes an alias function for mirdata.initialize() to directly initialize the mirdata loaders of Indian Art Music datasets.

Note

Print out the available datasets to load: compiam.list_datasets().

compiam.load_dataset(dataset_name, data_home=None, version='default')[source]

Alias function to load a mirdata Dataset class.

Parameters:
  • dataset_name – the dataset’s name, see mirdata.DATASETS for a complete list of possibilities.

  • data_home – path where the data lives. If None uses the default home location.

  • version – which version of the dataset to load. If None, the default version is loaded.

Returns:

a mirdata.core.Dataset object.

Access the Dunya corpora

Use the Corpora class to access the Indian Art Music corpora in CompMusic. Please note that to access the corpora in CompMusic, you need to first register and get a personal access token. Said token will be required to use the functions to access the database.

class compiam.dunya.Corpora(tradition, cc, token)[source]

Dunya corpora class with access functions

download_concert(concert_id, output_dir)[source]

Download the mp3s of all recordings in a concert and save them to the specified directory.

Parameters:
  • concert_id – The MBID of the concert.

  • location – Where to save the mp3s to.

download_mp3(recording_id, output_dir)[source]

Download the mp3 of a document and save it to the specified directory.

Parameters:
  • recording_id – The MBID of the recording.

  • output_dir – Where to save the mp3 to.

Returns:

name of the saved file.

static get_annotation(recording_id, thetype, subtype=None, part=None, version=None)[source]

Alias function of _file_for_document in the Corpora class.

Parameters:
  • recording_id – Musicbrainz recording ID.

  • thetype – the computed filetype.

  • subtype – a subtype if the module has one.

  • part – the file part if the module has one.

  • version – a specific version, otherwise the most recent one will be used.

Returns:

The contents of the most recent version of the derived file.

get_artist(ambid)[source]

Get specific information about an artist.

Parameters:

ambid – An artist MBID.

Returns:

mbid, name, concerts, instruments, recordings. concerts, instruments and recordings include information from recording- and release-level relationships, as well as release artists.

get_collection()[source]

Get the documents (recordings) in a collection.

get_concert(cmbid)[source]

Get specific information about a concert.

Parameters:

cmbid – A concert mbid.

Returns:

mbid, title, artists, tracks. artists includes performance relationships attached to the recordings, the release, and the release artists.

get_instrument(instrument_id)[source]

Get specific information about an instrument.

Parameters:

instrument_id – An instrument id

Returns:

id, name, artists. artists includes artists with recording- and release- level performance relationships of this instrument.

get_metadata()[source]

Get the full metadata of the initialized corpora. It might take a while…

get_raga(raga_id)[source]

Get specific information about a raga.

Parameters:

raga_id – A raga id or uuid.

Returns:

uuid, name, artists, works, composers. artists includes artists with recording- and release- level relationships to a recording with this raga.

get_recording(rmbid)[source]

Get specific information about a recording.

Parameters:

rmbid – A recording MBID.

Returns:

mbid, title, artists, raga, tala, work. artists includes performance relationships attached to the recording, the release, and the release artists.

get_tala(tala_id)[source]

Get specific information about a tala.

Parameters:

tala_id – A tala id or uuid.

Returns:

uuid, name, artists, works, composers. artists includes artists with recording- and release- level relationships to a recording with this raga.

get_work(wmbid)[source]

Get specific information about a work.

Parameters:

wmbid – A work mbid.

Returns:

mbid, title, composers, ragas, talas, recordings.

static list_available_types(recording_id)[source]

Get the available source filetypes for a Musicbrainz recording.

Parameters:

recording_id – Musicbrainz recording ID.

Returns:

a list of filetypes in the database for this recording.

list_concerts()[source]

List the concerts in the database. This function will automatically page through API results.

Returns:

A list of dictionaries containing concert information: {"mbid": MusicBrainz Release ID, "title": title of the concert} For additional information about each concert use get_concert().

list_instruments()[source]

List the instruments in the database. This function will automatically page through API results.

Returns:

A list of dictionaries containing instrument information: {"id": instrument id, "name": Name of the instrument} For additional information about each instrument use get_instrument().

list_ragas()[source]

List the ragas in the database. This function will automatically page through API results.

Returns:

A list of dictionaries containing raga information: {"uuid": raga UUID, "name": name of the raga} For additional information about each raga use get_raga().

list_talas()[source]

List the talas in the database. This function will automatically page through API results.

Returns:

A list of dictionaries containing tala information: {"uuid": tala UUID, "name": name of the tala} For additional information about each tala use get_tala().

list_works()[source]

List the works in the database. This function will automatically page through API results.

Returns:

A list of dictionaries containing work information: {"mbid": MusicBrainz work ID, "name": work name} For additional information about each work use get_work().

static save_annotation(recording_id, thetype, location, subtype=None, part=None, version=None)[source]

A version of get_annotation that writes the parsed data into a file.

Parameters:
  • recording_id – Musicbrainz recording ID.

  • thetype – the computed filetype.

  • subtype – a subtype if the module has one.

  • part – the file part if the module has one.

  • version – a specific version, otherwise the most recent one will be used.

Returns:

None (a file containing the parsed data is written).

compiam.dunya.conn.get_mp3(recording_id)[source]

Get a mp3 from a specific mbid.

Parameters:

recording_id – Musicbrainz recording ID.

compiam.dunya.conn.set_hostname(hostname)[source]

Change the hostname of the dunya API endpoint.

Parameters:

hostname – The new dunya hostname to set. If you want to access over http or a different port, include them in the hostname, e.g. http://localhost:8000.

Returns:

None.

compiam.dunya.conn.set_token(token)[source]

Get an access token. You must call this before you can make.

Parameters:

token – your access token.

Returns:

None.