MythTV  master
Classes | Functions | Variables
musicbrainzngs.musicbrainz Namespace Reference

Classes

class  _DigestAuthHandler
 
class  _MusicbrainzHttpRequest
 
class  _rate_limit
 
class  _RedirectPasswordMgr
 
class  AUTH_IFSET
 
class  AUTH_NO
 
class  AUTH_YES
 
class  AuthenticationError
 
class  InvalidFilterError
 
class  InvalidIncludeError
 
class  InvalidSearchFieldError
 
class  MusicBrainzError
 
class  NetworkError
 
class  ResponseError
 
class  UsageError
 
class  WebServiceError
 

Functions

def _check_includes_impl (includes, valid_includes)
 
def _check_includes (entity, inc)
 
def _check_filter (values, valid)
 
def _check_filter_and_make_params (entity, includes, release_status=[], release_type=[])
 
def _docstring (entity, browse=False)
 
def auth (u, p)
 
def set_useragent (app, version, contact=None)
 
def set_hostname (new_hostname)
 
def set_rate_limit (limit_or_interval=1.0, new_requests=1)
 
def _safe_read (opener, req, body=None, max_retries=8, retry_delay_delta=2.0)
 
def mb_parser_null (resp)
 
def mb_parser_xml (resp)
 
def set_parser (new_parser_fun=None)
 
def set_format (fmt="xml")
 
def _mb_request (path, method='GET', auth_required=AUTH_NO, client_required=False, args=None, data=None, body=None)
 
def _get_auth_type (entity, id, includes)
 
def _do_mb_query (entity, id, includes=[], params={})
 
def _do_mb_search (entity, query='', fields={}, limit=None, offset=None, strict=False)
 
def _do_mb_delete (path)
 
def _do_mb_put (path)
 
def _do_mb_post (path, body)
 
def get_area_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_artist_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_instrument_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_label_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_place_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_event_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_recording_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_release_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_release_group_by_id (id, includes=[], release_status=[], release_type=[])
 
def get_series_by_id (id, includes=[])
 
def get_work_by_id (id, includes=[])
 
def get_url_by_id (id, includes=[])
 
def search_annotations (query='', limit=None, offset=None, strict=False, **fields)
 
def search_areas (query='', limit=None, offset=None, strict=False, **fields)
 
def search_artists (query='', limit=None, offset=None, strict=False, **fields)
 
def search_events (query='', limit=None, offset=None, strict=False, **fields)
 
def search_instruments (query='', limit=None, offset=None, strict=False, **fields)
 
def search_labels (query='', limit=None, offset=None, strict=False, **fields)
 
def search_recordings (query='', limit=None, offset=None, strict=False, **fields)
 
def search_releases (query='', limit=None, offset=None, strict=False, **fields)
 
def search_release_groups (query='', limit=None, offset=None, strict=False, **fields)
 
def search_series (query='', limit=None, offset=None, strict=False, **fields)
 
def search_works (query='', limit=None, offset=None, strict=False, **fields)
 
def get_releases_by_discid (id, includes=[], toc=None, cdstubs=True, media_format=None)
 
def get_recordings_by_echoprint (echoprint, includes=[], release_status=[], release_type=[])
 
def get_recordings_by_puid (puid, includes=[], release_status=[], release_type=[])
 
def get_recordings_by_isrc (isrc, includes=[], release_status=[], release_type=[])
 
def get_works_by_iswc (iswc, includes=[])
 
def _browse_impl (entity, includes, valid_includes, limit, offset, params, release_status=[], release_type=[])
 
def browse_artists (recording=None, release=None, release_group=None, includes=[], limit=None, offset=None)
 
def browse_events (area=None, artist=None, place=None, includes=[], limit=None, offset=None)
 
def browse_labels (release=None, includes=[], limit=None, offset=None)
 
def browse_recordings (artist=None, release=None, includes=[], limit=None, offset=None)
 
def browse_releases (artist=None, track_artist=None, label=None, recording=None, release_group=None, release_status=[], release_type=[], includes=[], limit=None, offset=None)
 
def browse_release_groups (artist=None, release=None, release_type=[], includes=[], limit=None, offset=None)
 
def browse_urls (resource=None, includes=[], limit=None, offset=None)
 
def get_collections ()
 
def get_releases_in_collection (collection, limit=None, offset=None)
 
def submit_barcodes (release_barcode)
 
def submit_puids (recording_puids)
 
def submit_echoprints (recording_echoprints)
 
def submit_isrcs (recording_isrcs)
 
def submit_tags (**kwargs)
 
def submit_ratings (**kwargs)
 
def add_releases_to_collection (collection, releases=[])
 
def remove_releases_from_collection (collection, releases=[])
 

Variables

string _version = "0.6dev"
 
 _log = logging.getLogger("musicbrainzngs")
 
string LUCENE_SPECIAL = r'([+\-&|!(){}\[\]\^"~*?:\\\/])'
 
list RELATABLE_TYPES = ['area', 'artist', 'label', 'place', 'event', 'recording', 'release', 'release-group', 'series', 'url', 'work', 'instrument']
 
list RELATION_INCLUDES = [entity + '-rels' for entity in RELATABLE_TYPES]
 
list TAG_INCLUDES = ["tags", "user-tags"]
 
list RATING_INCLUDES = ["ratings", "user-ratings"]
 
dictionary VALID_INCLUDES
 
dictionary VALID_BROWSE_INCLUDES
 
list VALID_RELEASE_TYPES
 
list VALID_RELEASE_STATUSES = ["official", "promotion", "bootleg", "pseudo-release"]
 
dictionary VALID_SEARCH_FIELDS
 
string user = ""
 
string hostname = "musicbrainz.org"
 
string _client = ""
 
string _useragent = ""
 
float limit_interval = 1.0
 
int limit_requests = 1
 
bool do_rate_limit = True
 
tuple ETREE_EXCEPTIONS = (etree.ParseError, expat.ExpatError)
 
def parser_fun = mb_parser_xml
 
string ws_format = "xml"
 

Function Documentation

◆ _check_includes_impl()

def musicbrainzngs.musicbrainz._check_includes_impl (   includes,
  valid_includes 
)
private

◆ _check_includes()

def musicbrainzngs.musicbrainz._check_includes (   entity,
  inc 
)
private

Definition at line 228 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz._do_mb_query().

◆ _check_filter()

def musicbrainzngs.musicbrainz._check_filter (   values,
  valid 
)
private

◆ _check_filter_and_make_params()

def musicbrainzngs.musicbrainz._check_filter_and_make_params (   entity,
  includes,
  release_status = [],
  release_type = [] 
)
private

◆ _docstring()

def musicbrainzngs.musicbrainz._docstring (   entity,
  browse = False 
)
private

Definition at line 265 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz._browse_impl(), musicbrainzngs.musicbrainz._do_mb_post(), musicbrainzngs.musicbrainz.browse_artists(), musicbrainzngs.musicbrainz.browse_events(), musicbrainzngs.musicbrainz.browse_labels(), musicbrainzngs.musicbrainz.browse_recordings(), musicbrainzngs.musicbrainz.browse_release_groups(), musicbrainzngs.musicbrainz.browse_releases(), musicbrainzngs.musicbrainz.get_area_by_id(), musicbrainzngs.musicbrainz.get_artist_by_id(), musicbrainzngs.musicbrainz.get_event_by_id(), musicbrainzngs.musicbrainz.get_instrument_by_id(), musicbrainzngs.musicbrainz.get_label_by_id(), musicbrainzngs.musicbrainz.get_place_by_id(), musicbrainzngs.musicbrainz.get_recording_by_id(), musicbrainzngs.musicbrainz.get_recordings_by_echoprint(), musicbrainzngs.musicbrainz.get_recordings_by_isrc(), musicbrainzngs.musicbrainz.get_recordings_by_puid(), musicbrainzngs.musicbrainz.get_release_by_id(), musicbrainzngs.musicbrainz.get_release_group_by_id(), musicbrainzngs.musicbrainz.get_releases_by_discid(), musicbrainzngs.musicbrainz.get_series_by_id(), musicbrainzngs.musicbrainz.get_url_by_id(), musicbrainzngs.musicbrainz.get_work_by_id(), musicbrainzngs.musicbrainz.search_annotations(), musicbrainzngs.musicbrainz.search_areas(), musicbrainzngs.musicbrainz.search_artists(), musicbrainzngs.musicbrainz.search_events(), musicbrainzngs.musicbrainz.search_instruments(), musicbrainzngs.musicbrainz.search_labels(), musicbrainzngs.musicbrainz.search_recordings(), musicbrainzngs.musicbrainz.search_release_groups(), musicbrainzngs.musicbrainz.search_releases(), musicbrainzngs.musicbrainz.search_series(), and musicbrainzngs.musicbrainz.search_works().

◆ auth()

def musicbrainzngs.musicbrainz.auth (   u,
  p 
)
Set the username and password to be used in subsequent queries to
the MusicBrainz XML API that require authentication.

Definition at line 292 of file musicbrainz.py.

Referenced by CetonStreamHandler.CetonStreamHandler(), DigestMd5Response(), MythAirplayServer.HandleResponse(), and MythRAOPConnection.ProcessRequest().

◆ set_useragent()

def musicbrainzngs.musicbrainz.set_useragent (   app,
  version,
  contact = None 
)
Set the User-Agent to be used for requests to the MusicBrainz webservice.
This must be set before requests are made.

Definition at line 300 of file musicbrainz.py.

◆ set_hostname()

def musicbrainzngs.musicbrainz.set_hostname (   new_hostname)
Set the hostname for MusicBrainz webservice requests.
Defaults to 'musicbrainz.org'.
You can also include a port: 'localhost:8000'.

Definition at line 313 of file musicbrainz.py.

◆ set_rate_limit()

def musicbrainzngs.musicbrainz.set_rate_limit (   limit_or_interval = 1.0,
  new_requests = 1 
)
Sets the rate limiting behavior of the module. Must be invoked
before the first Web service call.
If the `limit_or_interval` parameter is set to False then
rate limiting will be disabled. If it is a number then only
a set number of requests (`new_requests`) will be made per
given interval (`limit_or_interval`).

Definition at line 326 of file musicbrainz.py.

◆ _safe_read()

def musicbrainzngs.musicbrainz._safe_read (   opener,
  req,
  body = None,
  max_retries = 8,
  retry_delay_delta = 2.0 
)
private
Open an HTTP request with a given URL opener and (optionally) a
request body. Transient errors lead to retries.  Permanent errors
and repeated errors are translated into a small set of handleable
exceptions. Return a bytestring.

Definition at line 457 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz._mb_request().

◆ mb_parser_null()

def musicbrainzngs.musicbrainz.mb_parser_null (   resp)
Return the raw response (XML)

Definition at line 525 of file musicbrainz.py.

◆ mb_parser_xml()

def musicbrainzngs.musicbrainz.mb_parser_xml (   resp)
Return a Python dict representing the XML response

Definition at line 529 of file musicbrainz.py.

◆ set_parser()

def musicbrainzngs.musicbrainz.set_parser (   new_parser_fun = None)
Sets the function used to parse the response from the
MusicBrainz web service.

If no parser is given, the parser is reset to the default parser
:func:`mb_parser_xml`.

Definition at line 546 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz.set_format().

◆ set_format()

def musicbrainzngs.musicbrainz.set_format (   fmt = "xml")
Sets the format that should be returned by the Web Service.
The server currently supports `xml` and `json`.

This method will set a default parser for the specified format,
but you can modify it with :func:`set_parser`.

.. warning:: The json format used by the server is different from
    the json format returned by the `musicbrainzngs` internal parser
    when using the `xml` format! This format may change at any time.

Definition at line 560 of file musicbrainz.py.

◆ _mb_request()

def musicbrainzngs.musicbrainz._mb_request (   path,
  method = 'GET',
  auth_required = AUTH_NO,
  client_required = False,
  args = None,
  data = None,
  body = None 
)
private
Makes a request for the specified `path` (endpoint) on /ws/2 on
the globally-specified hostname. Parses the responses and returns
the resulting object.  `auth_required` and `client_required` control
whether exceptions should be raised if the username/password and
client are left unspecified, respectively.

Definition at line 584 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz._do_mb_delete(), musicbrainzngs.musicbrainz._do_mb_post(), musicbrainzngs.musicbrainz._do_mb_put(), and musicbrainzngs.musicbrainz._do_mb_query().

◆ _get_auth_type()

def musicbrainzngs.musicbrainz._get_auth_type (   entity,
  id,
  includes 
)
private
Some calls require authentication. This returns
True if a call does, False otherwise

Definition at line 670 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz._do_mb_query().

◆ _do_mb_query()

def musicbrainzngs.musicbrainz._do_mb_query (   entity,
  id,
  includes = [],
  params = {} 
)
private

◆ _do_mb_search()

def musicbrainzngs.musicbrainz._do_mb_search (   entity,
  query = '',
  fields = {},
  limit = None,
  offset = None,
  strict = False 
)
private
Perform a full-text search on the MusicBrainz search server.
`query` is a lucene query string when no fields are set,
but is escaped when any fields are given. `fields` is a dictionary
of key/value query parameters. They keys in `fields` must be valid
for the given entity type.

Definition at line 706 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz.search_annotations(), musicbrainzngs.musicbrainz.search_areas(), musicbrainzngs.musicbrainz.search_artists(), musicbrainzngs.musicbrainz.search_events(), musicbrainzngs.musicbrainz.search_instruments(), musicbrainzngs.musicbrainz.search_labels(), musicbrainzngs.musicbrainz.search_recordings(), musicbrainzngs.musicbrainz.search_release_groups(), musicbrainzngs.musicbrainz.search_releases(), musicbrainzngs.musicbrainz.search_series(), and musicbrainzngs.musicbrainz.search_works().

◆ _do_mb_delete()

def musicbrainzngs.musicbrainz._do_mb_delete (   path)
private
Send a DELETE request for the specified object.

Definition at line 764 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz.remove_releases_from_collection().

◆ _do_mb_put()

def musicbrainzngs.musicbrainz._do_mb_put (   path)
private
Send a PUT request for the specified object.

Definition at line 769 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz.add_releases_to_collection().

◆ _do_mb_post()

def musicbrainzngs.musicbrainz._do_mb_post (   path,
  body 
)
private
Perform a single POST call for an endpoint with a specified
request body.

Definition at line 774 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz.submit_barcodes(), musicbrainzngs.musicbrainz.submit_isrcs(), musicbrainzngs.musicbrainz.submit_ratings(), and musicbrainzngs.musicbrainz.submit_tags().

◆ get_area_by_id()

def musicbrainzngs.musicbrainz.get_area_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the area with the MusicBrainz `id` as a dict with an 'area' key.

*Available includes*: {includes}

Definition at line 786 of file musicbrainz.py.

◆ get_artist_by_id()

def musicbrainzngs.musicbrainz.get_artist_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the artist with the MusicBrainz `id` as a dict with an 'artist' key.

*Available includes*: {includes}

Definition at line 795 of file musicbrainz.py.

◆ get_instrument_by_id()

def musicbrainzngs.musicbrainz.get_instrument_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the instrument with the MusicBrainz `id` as a dict with an 'artist' key.

*Available includes*: {includes}

Definition at line 804 of file musicbrainz.py.

◆ get_label_by_id()

def musicbrainzngs.musicbrainz.get_label_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the label with the MusicBrainz `id` as a dict with a 'label' key.

*Available includes*: {includes}

Definition at line 813 of file musicbrainz.py.

◆ get_place_by_id()

def musicbrainzngs.musicbrainz.get_place_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the place with the MusicBrainz `id` as a dict with an 'place' key.

*Available includes*: {includes}

Definition at line 822 of file musicbrainz.py.

◆ get_event_by_id()

def musicbrainzngs.musicbrainz.get_event_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the event with the MusicBrainz `id` as a dict with an 'event' key.

The event dict has the following keys:
`id`, `type`, `name`, `time`, `disambiguation` and `life-span`.

*Available includes*: {includes}

Definition at line 831 of file musicbrainz.py.

◆ get_recording_by_id()

def musicbrainzngs.musicbrainz.get_recording_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the recording with the MusicBrainz `id` as a dict
with a 'recording' key.

*Available includes*: {includes}

Definition at line 843 of file musicbrainz.py.

◆ get_release_by_id()

def musicbrainzngs.musicbrainz.get_release_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the release with the MusicBrainz `id` as a dict with a 'release' key.

*Available includes*: {includes}

Definition at line 853 of file musicbrainz.py.

◆ get_release_group_by_id()

def musicbrainzngs.musicbrainz.get_release_group_by_id (   id,
  includes = [],
  release_status = [],
  release_type = [] 
)
Get the release group with the MusicBrainz `id` as a dict
with a 'release-group' key.

*Available includes*: {includes}

Definition at line 862 of file musicbrainz.py.

◆ get_series_by_id()

def musicbrainzngs.musicbrainz.get_series_by_id (   id,
  includes = [] 
)
Get the series with the MusicBrainz `id` as a dict with a 'series' key.

*Available includes*: {includes}

Definition at line 873 of file musicbrainz.py.

◆ get_work_by_id()

def musicbrainzngs.musicbrainz.get_work_by_id (   id,
  includes = [] 
)
Get the work with the MusicBrainz `id` as a dict with a 'work' key.

*Available includes*: {includes}

Definition at line 880 of file musicbrainz.py.

◆ get_url_by_id()

def musicbrainzngs.musicbrainz.get_url_by_id (   id,
  includes = [] 
)
Get the url with the MusicBrainz `id` as a dict with a 'url' key.

*Available includes*: {includes}

Definition at line 887 of file musicbrainz.py.

◆ search_annotations()

def musicbrainzngs.musicbrainz.search_annotations (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for annotations and return a dict with an 'annotation-list' key.

*Available search fields*: {fields}

Definition at line 897 of file musicbrainz.py.

◆ search_areas()

def musicbrainzngs.musicbrainz.search_areas (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for areas and return a dict with an 'area-list' key.

*Available search fields*: {fields}

Definition at line 904 of file musicbrainz.py.

◆ search_artists()

def musicbrainzngs.musicbrainz.search_artists (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for artists and return a dict with an 'artist-list' key.

*Available search fields*: {fields}

Definition at line 911 of file musicbrainz.py.

◆ search_events()

def musicbrainzngs.musicbrainz.search_events (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for events and return a dict with an 'event-list' key.

*Available search fields*: {fields}

Definition at line 918 of file musicbrainz.py.

◆ search_instruments()

def musicbrainzngs.musicbrainz.search_instruments (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for instruments and return a dict with a 'instrument-list' key.

*Available search fields*: {fields}

Definition at line 925 of file musicbrainz.py.

◆ search_labels()

def musicbrainzngs.musicbrainz.search_labels (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for labels and return a dict with a 'label-list' key.

*Available search fields*: {fields}

Definition at line 932 of file musicbrainz.py.

◆ search_recordings()

def musicbrainzngs.musicbrainz.search_recordings (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for recordings and return a dict with a 'recording-list' key.

*Available search fields*: {fields}

Definition at line 939 of file musicbrainz.py.

◆ search_releases()

def musicbrainzngs.musicbrainz.search_releases (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for recordings and return a dict with a 'recording-list' key.

*Available search fields*: {fields}

Definition at line 947 of file musicbrainz.py.

◆ search_release_groups()

def musicbrainzngs.musicbrainz.search_release_groups (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for release groups and return a dict
with a 'release-group-list' key.

*Available search fields*: {fields}

Definition at line 954 of file musicbrainz.py.

◆ search_series()

def musicbrainzngs.musicbrainz.search_series (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for series and return a dict with a 'series-list' key.

*Available search fields*: {fields}

Definition at line 963 of file musicbrainz.py.

◆ search_works()

def musicbrainzngs.musicbrainz.search_works (   query = '',
  limit = None,
  offset = None,
  strict = False,
**  fields 
)
Search for works and return a dict with a 'work-list' key.

*Available search fields*: {fields}

Definition at line 970 of file musicbrainz.py.

◆ get_releases_by_discid()

def musicbrainzngs.musicbrainz.get_releases_by_discid (   id,
  includes = [],
  toc = None,
  cdstubs = True,
  media_format = None 
)
Search for releases with a :musicbrainz:`Disc ID` or table of contents.

When a `toc` is provided and no release with the disc ID is found,
a fuzzy search by the toc is done.
The `toc` should have to same format as :attr:`discid.Disc.toc_string`.
When a `toc` is provided, the format of the discid itself is not
checked server-side, so any value may be passed if searching by only
`toc` is desired.

If no toc matches in musicbrainz but a :musicbrainz:`CD Stub` does,
the CD Stub will be returned. Prevent this from happening by
passing `cdstubs=False`.

By default only results that match a format that allows discids
(e.g. CD) are included. To include all media formats, pass
`media_format='all'`.

The result is a dict with either a 'disc' , a 'cdstub' key
or a 'release-list' (fuzzy match with TOC).
A 'disc' has an 'offset-count', an 'offset-list' and a 'release-list'.
A 'cdstub' key has direct 'artist' and 'title' keys.

*Available includes*: {includes}

Definition at line 979 of file musicbrainz.py.

◆ get_recordings_by_echoprint()

def musicbrainzngs.musicbrainz.get_recordings_by_echoprint (   echoprint,
  includes = [],
  release_status = [],
  release_type = [] 
)
Search for recordings with an `echoprint <http://echoprint.me>`_.
(not available on server)

Definition at line 1014 of file musicbrainz.py.

◆ get_recordings_by_puid()

def musicbrainzngs.musicbrainz.get_recordings_by_puid (   puid,
  includes = [],
  release_status = [],
  release_type = [] 
)
Search for recordings with a :musicbrainz:`PUID`.
(not available on server)

Definition at line 1025 of file musicbrainz.py.

◆ get_recordings_by_isrc()

def musicbrainzngs.musicbrainz.get_recordings_by_isrc (   isrc,
  includes = [],
  release_status = [],
  release_type = [] 
)
Search for recordings with an :musicbrainz:`ISRC`.
The result is a dict with an 'isrc' key,
which again includes a 'recording-list'.

*Available includes*: {includes}

Definition at line 1036 of file musicbrainz.py.

◆ get_works_by_iswc()

def musicbrainzngs.musicbrainz.get_works_by_iswc (   iswc,
  includes = [] 
)
Search for works with an :musicbrainz:`ISWC`.
The result is a dict with a`work-list`.

*Available includes*: {includes}

Definition at line 1048 of file musicbrainz.py.

◆ _browse_impl()

def musicbrainzngs.musicbrainz._browse_impl (   entity,
  includes,
  valid_includes,
  limit,
  offset,
  params,
  release_status = [],
  release_type = [] 
)
private

◆ browse_artists()

def musicbrainzngs.musicbrainz.browse_artists (   recording = None,
  release = None,
  release_group = None,
  includes = [],
  limit = None,
  offset = None 
)
Get all artists linked to a recording, a release or a release group.
You need to give one MusicBrainz ID.

*Available includes*: {includes}

Definition at line 1074 of file musicbrainz.py.

◆ browse_events()

def musicbrainzngs.musicbrainz.browse_events (   area = None,
  artist = None,
  place = None,
  includes = [],
  limit = None,
  offset = None 
)
Get all events linked to a area, a artist or a place.
You need to give one MusicBrainz ID.

*Available includes*: {includes}

Definition at line 1089 of file musicbrainz.py.

◆ browse_labels()

def musicbrainzngs.musicbrainz.browse_labels (   release = None,
  includes = [],
  limit = None,
  offset = None 
)
Get all labels linked to a relase. You need to give a MusicBrainz ID.

*Available includes*: {includes}

Definition at line 1103 of file musicbrainz.py.

◆ browse_recordings()

def musicbrainzngs.musicbrainz.browse_recordings (   artist = None,
  release = None,
  includes = [],
  limit = None,
  offset = None 
)
Get all recordings linked to an artist or a release.
You need to give one MusicBrainz ID.

*Available includes*: {includes}

Definition at line 1113 of file musicbrainz.py.

◆ browse_releases()

def musicbrainzngs.musicbrainz.browse_releases (   artist = None,
  track_artist = None,
  label = None,
  recording = None,
  release_group = None,
  release_status = [],
  release_type = [],
  includes = [],
  limit = None,
  offset = None 
)
Get all releases linked to an artist, a label, a recording
or a release group. You need to give one MusicBrainz ID.

You can also browse by `track_artist`, which gives all releases where some
tracks are attributed to that artist, but not the whole release.

You can filter by :data:`musicbrainz.VALID_RELEASE_TYPES` or
:data:`musicbrainz.VALID_RELEASE_STATUSES`.

*Available includes*: {includes}

Definition at line 1126 of file musicbrainz.py.

◆ browse_release_groups()

def musicbrainzngs.musicbrainz.browse_release_groups (   artist = None,
  release = None,
  release_type = [],
  includes = [],
  limit = None,
  offset = None 
)
Get all release groups linked to an artist or a release.
You need to give one MusicBrainz ID.

You can filter by :data:`musicbrainz.VALID_RELEASE_TYPES`.

*Available includes*: {includes}

Definition at line 1150 of file musicbrainz.py.

◆ browse_urls()

def musicbrainzngs.musicbrainz.browse_urls (   resource = None,
  includes = [],
  limit = None,
  offset = None 
)
Get urls by actual URL string.
You need to give a URL string as 'resource'

*Available includes*: {includes}

Definition at line 1165 of file musicbrainz.py.

◆ get_collections()

def musicbrainzngs.musicbrainz.get_collections ( )
List the collections for the currently :func:`authenticated <auth>` user
as a dict with a 'collection-list' key.

Definition at line 1179 of file musicbrainz.py.

◆ get_releases_in_collection()

def musicbrainzngs.musicbrainz.get_releases_in_collection (   collection,
  limit = None,
  offset = None 
)
List the releases in a collection.
Returns a dict with a 'collection' key, which again has a 'release-list'.

See `Browsing`_ for how to use `limit` and `offset`.

Definition at line 1185 of file musicbrainz.py.

◆ submit_barcodes()

def musicbrainzngs.musicbrainz.submit_barcodes (   release_barcode)
Submits a set of {release_id1: barcode, ...}

Definition at line 1199 of file musicbrainz.py.

◆ submit_puids()

def musicbrainzngs.musicbrainz.submit_puids (   recording_puids)
Submit PUIDs.
(Functionality removed from server)

Definition at line 1204 of file musicbrainz.py.

◆ submit_echoprints()

def musicbrainzngs.musicbrainz.submit_echoprints (   recording_echoprints)
Submit echoprints.
(Functionality removed from server)

Definition at line 1213 of file musicbrainz.py.

◆ submit_isrcs()

def musicbrainzngs.musicbrainz.submit_isrcs (   recording_isrcs)
Submit ISRCs.
Submits a set of {recording-id1: [isrc1, ...], ...}
or {recording_id1: isrc, ...}.

Definition at line 1222 of file musicbrainz.py.

◆ submit_tags()

def musicbrainzngs.musicbrainz.submit_tags ( **  kwargs)
Submit user tags.
Takes parameters named e.g. 'artist_tags', 'recording_tags', etc.,
and of the form:
{entity_id1: [tag1, ...], ...}

The user's tags for each entity will be set to that list, adding or
removing tags as necessary. Submitting an empty list for an entity
will remove all tags for that entity by the user.

Definition at line 1233 of file musicbrainz.py.

◆ submit_ratings()

def musicbrainzngs.musicbrainz.submit_ratings ( **  kwargs)
Submit user ratings.
Takes parameters named e.g. 'artist_ratings', 'recording_ratings', etc.,
and of the form:
{entity_id1: rating, ...}

Ratings are numbers from 0-100, at intervals of 20 (20 per 'star').
Submitting a rating of 0 will remove the user's rating.

Definition at line 1246 of file musicbrainz.py.

◆ add_releases_to_collection()

def musicbrainzngs.musicbrainz.add_releases_to_collection (   collection,
  releases = [] 
)
Add releases to a collection.
Collection and releases should be identified by their MBIDs

Definition at line 1258 of file musicbrainz.py.

◆ remove_releases_from_collection()

def musicbrainzngs.musicbrainz.remove_releases_from_collection (   collection,
  releases = [] 
)
Remove releases from a collection.
Collection and releases should be identified by their MBIDs

Definition at line 1266 of file musicbrainz.py.

Variable Documentation

◆ _version

string musicbrainzngs.musicbrainz._version = "0.6dev"
private

Definition at line 23 of file musicbrainz.py.

◆ _log

musicbrainzngs.musicbrainz._log = logging.getLogger("musicbrainzngs")
private

Definition at line 24 of file musicbrainz.py.

◆ LUCENE_SPECIAL

string musicbrainzngs.musicbrainz.LUCENE_SPECIAL = r'([+\-&|!(){}\[\]\^"~*?:\\\/])'

Definition at line 26 of file musicbrainz.py.

◆ RELATABLE_TYPES

list musicbrainzngs.musicbrainz.RELATABLE_TYPES = ['area', 'artist', 'label', 'place', 'event', 'recording', 'release', 'release-group', 'series', 'url', 'work', 'instrument']

Definition at line 30 of file musicbrainz.py.

◆ RELATION_INCLUDES

list musicbrainzngs.musicbrainz.RELATION_INCLUDES = [entity + '-rels' for entity in RELATABLE_TYPES]

Definition at line 31 of file musicbrainz.py.

◆ TAG_INCLUDES

list musicbrainzngs.musicbrainz.TAG_INCLUDES = ["tags", "user-tags"]

Definition at line 32 of file musicbrainz.py.

◆ RATING_INCLUDES

list musicbrainzngs.musicbrainz.RATING_INCLUDES = ["ratings", "user-ratings"]

Definition at line 33 of file musicbrainz.py.

◆ VALID_INCLUDES

dictionary musicbrainzngs.musicbrainz.VALID_INCLUDES

Definition at line 35 of file musicbrainz.py.

◆ VALID_BROWSE_INCLUDES

dictionary musicbrainzngs.musicbrainz.VALID_BROWSE_INCLUDES
Initial value:
1 = {
2  'releases': ["artist-credits", "labels", "recordings", "isrcs",
3  "release-groups", "media", "discids"] + RELATION_INCLUDES,
4  'recordings': ["artist-credits", "isrcs"] + TAG_INCLUDES + RATING_INCLUDES + RELATION_INCLUDES,
5  'labels': ["aliases"] + TAG_INCLUDES + RATING_INCLUDES + RELATION_INCLUDES,
6  'artists': ["aliases"] + TAG_INCLUDES + RATING_INCLUDES + RELATION_INCLUDES,
7  'events': ["aliases"] + TAG_INCLUDES + RATING_INCLUDES + RELATION_INCLUDES,
8  'urls': RELATION_INCLUDES,
9  'release-groups': ["artist-credits"] + TAG_INCLUDES + RATING_INCLUDES + RELATION_INCLUDES
10 }

Definition at line 85 of file musicbrainz.py.

◆ VALID_RELEASE_TYPES

list musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES
Initial value:
1 = [
2  "nat",
3  "album", "single", "ep", "broadcast", "other", # primary types
4  "compilation", "soundtrack", "spokenword", "interview", "audiobook",
5  "live", "remix", "dj-mix", "mixtape/street", # secondary types
6 ]

Definition at line 97 of file musicbrainz.py.

◆ VALID_RELEASE_STATUSES

list musicbrainzngs.musicbrainz.VALID_RELEASE_STATUSES = ["official", "promotion", "bootleg", "pseudo-release"]

Definition at line 104 of file musicbrainz.py.

◆ VALID_SEARCH_FIELDS

dictionary musicbrainzngs.musicbrainz.VALID_SEARCH_FIELDS

Definition at line 105 of file musicbrainz.py.

◆ user

string musicbrainzngs.musicbrainz.user = ""

Definition at line 287 of file musicbrainz.py.

Referenced by DigestMd5Response().

◆ hostname

string musicbrainzngs.musicbrainz.hostname = "musicbrainz.org"

Definition at line 288 of file musicbrainz.py.

◆ _client

string musicbrainzngs.musicbrainz._client = ""
private

Definition at line 289 of file musicbrainz.py.

◆ _useragent

string musicbrainzngs.musicbrainz._useragent = ""
private

Definition at line 290 of file musicbrainz.py.

◆ limit_interval

float musicbrainzngs.musicbrainz.limit_interval = 1.0

Definition at line 322 of file musicbrainz.py.

◆ limit_requests

int musicbrainzngs.musicbrainz.limit_requests = 1

Definition at line 323 of file musicbrainz.py.

◆ do_rate_limit

bool musicbrainzngs.musicbrainz.do_rate_limit = True

Definition at line 324 of file musicbrainz.py.

◆ ETREE_EXCEPTIONS

tuple musicbrainzngs.musicbrainz.ETREE_EXCEPTIONS = (etree.ParseError, expat.ExpatError)

Definition at line 518 of file musicbrainz.py.

◆ parser_fun

def musicbrainzngs.musicbrainz.parser_fun = mb_parser_xml

Definition at line 543 of file musicbrainz.py.

Referenced by musicbrainzngs.musicbrainz._mb_request().

◆ ws_format

string musicbrainzngs.musicbrainz.ws_format = "xml"

Definition at line 544 of file musicbrainz.py.