Home | Trees | Index | Help |
---|
Package musicbrainz2 :: Module utils |
|
Various utilities to simplify common tasks.
This module contains helper functions to make common tasks easier.Author: Matthias Friedrich <matt@mafr.de>
Function Summary | |
---|---|
Extract the fragment part from a URI. | |
Extract the UUID part from a MusicBrainz identifier. | |
Returns a country's name based on an ISO-3166 country code. | |
Returns a language name based on an ISO-639-2/T code. | |
Returns the name of a release type URI. | |
Returns a script name based on an ISO-15924 code. |
Function Details |
---|
extractFragment(uriStr, uriPrefix=None)Extract the fragment part from a URI. If uriPrefix parameter can be used for error checking.
If uriStr is an absolute URI, then the function checks if
it starts with uriPrefix . If it doesn't, a
ValueError exception is raised.
|
extractUuid(uriStr, resType=None)Extract the UUID part from a MusicBrainz identifier. This function takes a MusicBrainz ID (an absolute URI) as the input
and returns the UUID part of the URI, thus turning it into a relative
URI. If The >>> from musicbrainz2.utils import extractUuid >>> extractUuid('http://musicbrainz.org/artist/c0b2500e-0cef-4130-869d-732b23ed9df5', 'artist') 'c0b2500e-0cef-4130-869d-732b23ed9df5' >>>
|
getCountryName(id_)Returns a country's name based on an ISO-3166 country code. The country table this function is based on has been modified for MusicBrainz purposes by using the extension mechanism defined in ISO-3166. All IDs are still valid ISO-3166 country codes, but some IDs have been added to include historic countries and some of the country names have been modified to make them better suited for display purposes. If the country ID is not found, None is returned. This may happen for example, when new countries are added to the MusicBrainz web service which aren't known to this library yet.
|
getLanguageName(id_)Returns a language name based on an ISO-639-2/T code. This function uses a subset of the ISO-639-2/T code table to map language IDs (terminologic, not bibliographic ones!) to names.
|
getReleaseTypeName(releaseType)Returns the name of a release type URI.
|
getScriptName(id_)Returns a script name based on an ISO-15924 code. This function uses a subset of the ISO-15924 code table to map script IDs to names.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sat Aug 26 18:34:31 2006 | http://epydoc.sf.net |