MythTV  master
mbxml.py
Go to the documentation of this file.
1 # This file is part of the musicbrainzngs library
2 # Copyright (C) Alastair Porter, Adrian Sampson, and others
3 # This file is distributed under a BSD-2-Clause type license.
4 # See the COPYING file for more information.
5 
6 import re
7 import xml.etree.ElementTree as ET
8 import logging
9 
10 from musicbrainzngs import util
11 
12 try:
13  from ET import fixtag
14 except:
15  # Python < 2.7
16  def fixtag(tag, namespaces):
17  # given a decorated tag (of the form {uri}tag), return prefixed
18  # tag and namespace declaration, if any
19  if isinstance(tag, ET.QName):
20  tag = tag.text
21  namespace_uri, tag = tag[1:].split("}", 1)
22  prefix = namespaces.get(namespace_uri)
23  if prefix is None:
24  prefix = "ns%d" % len(namespaces)
25  namespaces[namespace_uri] = prefix
26  if prefix == "xml":
27  xmlns = None
28  else:
29  xmlns = ("xmlns:%s" % prefix, namespace_uri)
30  else:
31  xmlns = None
32  return "%s:%s" % (prefix, tag), xmlns
33 
34 
35 NS_MAP = {"http://musicbrainz.org/ns/mmd-2.0#": "ws2",
36  "http://musicbrainz.org/ns/ext#-2.0": "ext"}
37 _log = logging.getLogger("musicbrainzngs")
38 
39 def get_error_message(error):
40  """ Given an error XML message from the webservice containing
41  <error><text>x</text><text>y</text></error>, return a list
42  of [x, y]"""
43  try:
44  tree = util.bytes_to_elementtree(error)
45  root = tree.getroot()
46  errors = []
47  if root.tag == "error":
48  for ch in root:
49  if ch.tag == "text":
50  errors.append(ch.text)
51  return errors
52  except ET.ParseError:
53  return None
54 
55 def make_artist_credit(artists):
56  names = []
57  for artist in artists:
58  if isinstance(artist, dict):
59  if "name" in artist:
60  names.append(artist.get("name", ""))
61  else:
62  names.append(artist.get("artist", {}).get("name", ""))
63  else:
64  names.append(artist)
65  return "".join(names)
66 
67 def parse_elements(valid_els, inner_els, element):
68  """ Extract single level subelements from an element.
69  For example, given the element:
70  <element>
71  <subelement>Text</subelement>
72  </element>
73  and a list valid_els that contains "subelement",
74  return a dict {'subelement': 'Text'}
75 
76  Delegate the parsing of multi-level subelements to another function.
77  For example, given the element:
78  <element>
79  <subelement>
80  <a>Foo</a><b>Bar</b>
81  </subelement>
82  </element>
83  and a dictionary {'subelement': parse_subelement},
84  call parse_subelement(<subelement>) and
85  return a dict {'subelement': <result>}
86  if parse_subelement returns a tuple of the form
87  ('subelement-key', <result>) then return a dict
88  {'subelement-key': <result>} instead
89  """
90  result = {}
91  for sub in element:
92  t = fixtag(sub.tag, NS_MAP)[0]
93  if ":" in t:
94  t = t.split(":")[1]
95  if t in valid_els:
96  result[t] = sub.text or ""
97  elif t in inner_els.keys():
98  inner_result = inner_els[t](sub)
99  if isinstance(inner_result, tuple):
100  result[inner_result[0]] = inner_result[1]
101  else:
102  result[t] = inner_result
103  # add counts for lists when available
104  m = re.match(r'([a-z0-9-]+)-list', t)
105  if m and "count" in sub.attrib:
106  result["%s-count" % m.group(1)] = int(sub.attrib["count"])
107  else:
108  _log.info("in <%s>, uncaught <%s>",
109  fixtag(element.tag, NS_MAP)[0], t)
110  return result
111 
112 def parse_attributes(attributes, element):
113  """ Extract attributes from an element.
114  For example, given the element:
115  <element type="Group" />
116  and a list attributes that contains "type",
117  return a dict {'type': 'Group'}
118  """
119  result = {}
120  for attr in element.attrib:
121  if "{" in attr:
122  a = fixtag(attr, NS_MAP)[0]
123  else:
124  a = attr
125  if a in attributes:
126  result[a] = element.attrib[attr]
127  else:
128  _log.info("in <%s>, uncaught attribute %s", fixtag(element.tag, NS_MAP)[0], attr)
129 
130  return result
131 
132 def parse_message(message):
133  tree = util.bytes_to_elementtree(message)
134  root = tree.getroot()
135  result = {}
136  valid_elements = {"area": parse_area,
137  "artist": parse_artist,
138  "instrument": parse_instrument,
139  "label": parse_label,
140  "place": parse_place,
141  "event": parse_event,
142  "release": parse_release,
143  "release-group": parse_release_group,
144  "series": parse_series,
145  "recording": parse_recording,
146  "work": parse_work,
147  "url": parse_url,
148 
149  "disc": parse_disc,
150  "cdstub": parse_cdstub,
151  "isrc": parse_isrc,
152 
153  "annotation-list": parse_annotation_list,
154  "area-list": parse_area_list,
155  "artist-list": parse_artist_list,
156  "label-list": parse_label_list,
157  "place-list": parse_place_list,
158  "event-list": parse_event_list,
159  "instrument-list": parse_instrument_list,
160  "release-list": parse_release_list,
161  "release-group-list": parse_release_group_list,
162  "series-list": parse_series_list,
163  "recording-list": parse_recording_list,
164  "work-list": parse_work_list,
165  "url-list": parse_url_list,
166 
167  "collection-list": parse_collection_list,
168  "collection": parse_collection,
169 
170  "message": parse_response_message
171  }
172  result.update(parse_elements([], valid_elements, root))
173  return result
174 
176  return parse_elements(["text"], {}, message)
177 
179  return [parse_collection(c) for c in cl]
180 
181 def parse_collection(collection):
182  result = {}
183  attribs = ["id", "type", "entity-type"]
184  elements = ["name", "editor"]
185  # TODO: add event-list:
186  inner_els = {"release-list": parse_release_list}
187  result.update(parse_attributes(attribs, collection))
188  result.update(parse_elements(elements, inner_els, collection))
189 
190  return result
191 
193  return [parse_annotation(a) for a in al]
194 
195 def parse_annotation(annotation):
196  result = {}
197  attribs = ["type", "ext:score"]
198  elements = ["entity", "name", "text"]
199  result.update(parse_attributes(attribs, annotation))
200  result.update(parse_elements(elements, {}, annotation))
201  return result
202 
203 def parse_lifespan(lifespan):
204  parts = parse_elements(["begin", "end", "ended"], {}, lifespan)
205 
206  return parts
207 
209  return [parse_area(a) for a in al]
210 
211 def parse_area(area):
212  result = {}
213  attribs = ["id", "type", "ext:score"]
214  elements = ["name", "sort-name", "disambiguation"]
215  inner_els = {"life-span": parse_lifespan,
216  "alias-list": parse_alias_list,
217  "relation-list": parse_relation_list,
218  "annotation": parse_annotation,
219  "iso-3166-1-code-list": parse_element_list,
220  "iso-3166-2-code-list": parse_element_list,
221  "iso-3166-3-code-list": parse_element_list}
222 
223  result.update(parse_attributes(attribs, area))
224  result.update(parse_elements(elements, inner_els, area))
225 
226  return result
227 
229  return [parse_artist(a) for a in al]
230 
231 def parse_artist(artist):
232  result = {}
233  attribs = ["id", "type", "ext:score"]
234  elements = ["name", "sort-name", "country", "user-rating",
235  "disambiguation", "gender", "ipi"]
236  inner_els = {"area": parse_area,
237  "begin-area": parse_area,
238  "end-area": parse_area,
239  "life-span": parse_lifespan,
240  "recording-list": parse_recording_list,
241  "relation-list": parse_relation_list,
242  "release-list": parse_release_list,
243  "release-group-list": parse_release_group_list,
244  "work-list": parse_work_list,
245  "tag-list": parse_tag_list,
246  "user-tag-list": parse_tag_list,
247  "rating": parse_rating,
248  "ipi-list": parse_element_list,
249  "isni-list": parse_element_list,
250  "alias-list": parse_alias_list,
251  "annotation": parse_annotation}
252 
253  result.update(parse_attributes(attribs, artist))
254  result.update(parse_elements(elements, inner_els, artist))
255 
256  return result
257 
259  return parse_elements(['latitude', 'longitude'], {}, c)
260 
262  return [parse_place(p) for p in pl]
263 
264 def parse_place(place):
265  result = {}
266  attribs = ["id", "type", "ext:score"]
267  elements = ["name", "address",
268  "ipi", "disambiguation"]
269  inner_els = {"area": parse_area,
270  "coordinates": parse_coordinates,
271  "life-span": parse_lifespan,
272  "tag-list": parse_tag_list,
273  "user-tag-list": parse_tag_list,
274  "alias-list": parse_alias_list,
275  "relation-list": parse_relation_list,
276  "annotation": parse_annotation}
277 
278  result.update(parse_attributes(attribs, place))
279  result.update(parse_elements(elements, inner_els, place))
280 
281  return result
282 
284  return [parse_event(e) for e in el]
285 
286 def parse_event(event):
287  result = {}
288  attribs = ["id", "type"]
289  elements = ["name", "time"]
290  inner_els = {"life-span": parse_lifespan,
291  "relation-list": parse_relation_list}
292 
293  result.update(parse_attributes(attribs, event))
294  result.update(parse_elements(elements, inner_els, event))
295 
296  return result
297 
298 def parse_instrument(instrument):
299  result = {}
300  attribs = ["id", "type", "ext:score"]
301  elements = ["name", "description", "disambiguation"]
302  inner_els = {"relation-list": parse_relation_list,
303  "tag-list": parse_tag_list,
304  "alias-list": parse_alias_list,
305  "annotation": parse_annotation}
306  result.update(parse_attributes(attribs, instrument))
307  result.update(parse_elements(elements, inner_els, instrument))
308 
309  return result
310 
312  return [parse_label(l) for l in ll]
313 
314 def parse_label(label):
315  result = {}
316  attribs = ["id", "type", "ext:score"]
317  elements = ["name", "sort-name", "country", "label-code", "user-rating",
318  "ipi", "disambiguation"]
319  inner_els = {"area": parse_area,
320  "life-span": parse_lifespan,
321  "release-list": parse_release_list,
322  "tag-list": parse_tag_list,
323  "user-tag-list": parse_tag_list,
324  "rating": parse_rating,
325  "ipi-list": parse_element_list,
326  "alias-list": parse_alias_list,
327  "relation-list": parse_relation_list,
328  "annotation": parse_annotation}
329 
330  result.update(parse_attributes(attribs, label))
331  result.update(parse_elements(elements, inner_els, label))
332 
333  return result
334 
336  attributes = parse_attributes(['id'], tgt)
337  if 'id' in attributes:
338  return ('target-id', attributes['id'])
339  else:
340  return ('target-id', tgt.text)
341 
343  attribs = ["target-type"]
344  ttype = parse_attributes(attribs, rl)
345  key = "%s-relation-list" % ttype["target-type"]
346  return (key, [parse_relation(r) for r in rl])
347 
348 def parse_relation(relation):
349  result = {}
350  attribs = ["type", "type-id"]
351  elements = ["target", "direction", "begin", "end", "ended", "ordering-key"]
352  inner_els = {"area": parse_area,
353  "artist": parse_artist,
354  "instrument": parse_instrument,
355  "label": parse_label,
356  "place": parse_place,
357  "event": parse_event,
358  "recording": parse_recording,
359  "release": parse_release,
360  "release-group": parse_release_group,
361  "series": parse_series,
362  "attribute-list": parse_element_list,
363  "work": parse_work,
364  "target": parse_relation_target
365  }
366  result.update(parse_attributes(attribs, relation))
367  result.update(parse_elements(elements, inner_els, relation))
368 
369  return result
370 
371 def parse_release(release):
372  result = {}
373  attribs = ["id", "ext:score"]
374  elements = ["title", "status", "disambiguation", "quality", "country",
375  "barcode", "date", "packaging", "asin"]
376  inner_els = {"text-representation": parse_text_representation,
377  "artist-credit": parse_artist_credit,
378  "label-info-list": parse_label_info_list,
379  "medium-list": parse_medium_list,
380  "release-group": parse_release_group,
381  "tag-list": parse_tag_list,
382  "user-tag-list": parse_tag_list,
383  "relation-list": parse_relation_list,
384  "annotation": parse_annotation,
385  "cover-art-archive": parse_caa,
386  "release-event-list": parse_release_event_list}
387 
388  result.update(parse_attributes(attribs, release))
389  result.update(parse_elements(elements, inner_els, release))
390  if "artist-credit" in result:
391  result["artist-credit-phrase"] = make_artist_credit(
392  result["artist-credit"])
393 
394  return result
395 
397  return [parse_medium(m) for m in ml]
398 
400  return [parse_release_event(re) for re in rel]
401 
403  result = {}
404  elements = ["date"]
405  inner_els = {"area": parse_area}
406 
407  result.update(parse_elements(elements, inner_els, event))
408  return result
409 
410 def parse_medium(medium):
411  result = {}
412  elements = ["position", "format", "title"]
413  inner_els = {"disc-list": parse_disc_list,
414  "pregap": parse_track,
415  "track-list": parse_track_list,
416  "data-track-list": parse_track_list}
417 
418  result.update(parse_elements(elements, inner_els, medium))
419  return result
420 
422  return [parse_disc(d) for d in dl]
423 
425  return parse_elements(["language", "script"], {}, textr)
426 
428  result = {}
429  attribs = ["id", "type", "ext:score"]
430  elements = ["title", "user-rating", "first-release-date", "primary-type",
431  "disambiguation"]
432  inner_els = {"artist-credit": parse_artist_credit,
433  "release-list": parse_release_list,
434  "tag-list": parse_tag_list,
435  "user-tag-list": parse_tag_list,
436  "secondary-type-list": parse_element_list,
437  "relation-list": parse_relation_list,
438  "rating": parse_rating,
439  "annotation": parse_annotation}
440 
441  result.update(parse_attributes(attribs, rg))
442  result.update(parse_elements(elements, inner_els, rg))
443  if "artist-credit" in result:
444  result["artist-credit-phrase"] = make_artist_credit(result["artist-credit"])
445 
446  return result
447 
448 def parse_recording(recording):
449  result = {}
450  attribs = ["id", "ext:score"]
451  elements = ["title", "length", "user-rating", "disambiguation", "video"]
452  inner_els = {"artist-credit": parse_artist_credit,
453  "release-list": parse_release_list,
454  "tag-list": parse_tag_list,
455  "user-tag-list": parse_tag_list,
456  "rating": parse_rating,
457  "isrc-list": parse_external_id_list,
458  "echoprint-list": parse_external_id_list,
459  "relation-list": parse_relation_list,
460  "annotation": parse_annotation}
461 
462  result.update(parse_attributes(attribs, recording))
463  result.update(parse_elements(elements, inner_els, recording))
464  if "artist-credit" in result:
465  result["artist-credit-phrase"] = make_artist_credit(result["artist-credit"])
466 
467  return result
468 
470  return [parse_series(s) for s in sl]
471 
472 def parse_series(series):
473  result = {}
474  attribs = ["id", "type", "ext:score"]
475  elements = ["name", "disambiguation"]
476  inner_els = {"alias-list": parse_alias_list,
477  "relation-list": parse_relation_list,
478  "annotation": parse_annotation}
479 
480  result.update(parse_attributes(attribs, series))
481  result.update(parse_elements(elements, inner_els, series))
482 
483  return result
484 
486  return [parse_attributes(["id"], p)["id"] for p in pl]
487 
489  return [e.text for e in el]
490 
492  return [parse_work(w) for w in wl]
493 
494 def parse_work(work):
495  result = {}
496  attribs = ["id", "ext:score", "type"]
497  elements = ["title", "user-rating", "language", "iswc", "disambiguation"]
498  inner_els = {"tag-list": parse_tag_list,
499  "user-tag-list": parse_tag_list,
500  "rating": parse_rating,
501  "alias-list": parse_alias_list,
502  "iswc-list": parse_element_list,
503  "relation-list": parse_relation_list,
504  "annotation": parse_response_message,
505  "attribute-list": parse_work_attribute_list
506  }
507 
508  result.update(parse_attributes(attribs, work))
509  result.update(parse_elements(elements, inner_els, work))
510 
511  return result
512 
514  return [parse_work_attribute(wa) for wa in wal]
515 
517  result = {}
518  attribs = ["type"]
519 
520  result.update(parse_attributes(attribs, wa))
521  result["attribute"] = wa.text
522 
523  return result
524 
525 
527  return [parse_url(u) for u in ul]
528 
529 def parse_url(url):
530  result = {}
531  attribs = ["id"]
532  elements = ["resource"]
533  inner_els = {"relation-list": parse_relation_list}
534 
535  result.update(parse_attributes(attribs, url))
536  result.update(parse_elements(elements, inner_els, url))
537 
538  return result
539 
540 def parse_disc(disc):
541  result = {}
542  attribs = ["id"]
543  elements = ["sectors"]
544  inner_els = {"release-list": parse_release_list,
545  "offset-list": parse_offset_list
546  }
547 
548  result.update(parse_attributes(attribs, disc))
549  result.update(parse_elements(elements, inner_els, disc))
550 
551  return result
552 
553 def parse_cdstub(cdstub):
554  result = {}
555  attribs = ["id"]
556  elements = ["title", "artist", "barcode"]
557  inner_els = {"track-list": parse_track_list}
558 
559  result.update(parse_attributes(attribs, cdstub))
560  result.update(parse_elements(elements, inner_els, cdstub))
561 
562  return result
563 
565  return [int(o.text) for o in ol]
566 
568  result = []
569  for r in rl:
570  result.append(parse_instrument(r))
571  return result
572 
574  result = []
575  for r in rl:
576  result.append(parse_release(r))
577  return result
578 
580  result = []
581  for rg in rgl:
582  result.append(parse_release_group(rg))
583  return result
584 
585 def parse_isrc(isrc):
586  result = {}
587  attribs = ["id"]
588  inner_els = {"recording-list": parse_recording_list}
589 
590  result.update(parse_attributes(attribs, isrc))
591  result.update(parse_elements([], inner_els, isrc))
592 
593  return result
594 
596  result = []
597  for r in recs:
598  result.append(parse_recording(r))
599  return result
600 
602  result = []
603  for namecredit in ac:
604  result.append(parse_name_credit(namecredit))
605  join = parse_attributes(["joinphrase"], namecredit)
606  if "joinphrase" in join:
607  result.append(join["joinphrase"])
608  return result
609 
611  result = {}
612  elements = ["name"]
613  inner_els = {"artist": parse_artist}
614 
615  result.update(parse_elements(elements, inner_els, nc))
616 
617  return result
618 
620  result = []
621 
622  for li in lil:
623  result.append(parse_label_info(li))
624  return result
625 
627  result = {}
628  elements = ["catalog-number"]
629  inner_els = {"label": parse_label}
630 
631  result.update(parse_elements(elements, inner_els, li))
632  return result
633 
635  result = []
636  for t in tl:
637  result.append(parse_track(t))
638  return result
639 
640 def parse_track(track):
641  result = {}
642  attribs = ["id"]
643  elements = ["number", "position", "title", "length"]
644  inner_els = {"recording": parse_recording,
645  "artist-credit": parse_artist_credit}
646 
647  result.update(parse_attributes(attribs, track))
648  result.update(parse_elements(elements, inner_els, track))
649  if "artist-credit" in result.get("recording", {}) and "artist-credit" not in result:
650  result["artist-credit"] = result["recording"]["artist-credit"]
651  if "artist-credit" in result:
652  result["artist-credit-phrase"] = make_artist_credit(result["artist-credit"])
653  # Make a length field that contains track length or recording length
654  track_or_recording = None
655  if "length" in result:
656  track_or_recording = result["length"]
657  elif result.get("recording", {}).get("length"):
658  track_or_recording = result.get("recording", {}).get("length")
659  if track_or_recording:
660  result["track_or_recording_length"] = track_or_recording
661  return result
662 
664  return [parse_tag(t) for t in tl]
665 
666 def parse_tag(tag):
667  result = {}
668  attribs = ["count"]
669  elements = ["name"]
670 
671  result.update(parse_attributes(attribs, tag))
672  result.update(parse_elements(elements, {}, tag))
673 
674  return result
675 
676 def parse_rating(rating):
677  result = {}
678  attribs = ["votes-count"]
679 
680  result.update(parse_attributes(attribs, rating))
681  result["rating"] = rating.text
682 
683  return result
684 
686  return [parse_alias(a) for a in al]
687 
688 def parse_alias(alias):
689  result = {}
690  attribs = ["locale", "sort-name", "type", "primary",
691  "begin-date", "end-date"]
692 
693  result.update(parse_attributes(attribs, alias))
694  result["alias"] = alias.text
695 
696  return result
697 
698 def parse_caa(caa_element):
699  result = {}
700  elements = ["artwork", "count", "front", "back", "darkened"]
701 
702  result.update(parse_elements(elements, {}, caa_element))
703  return result
704 
705 
706 
707 
708 def make_barcode_request(release2barcode):
709  NS = "http://musicbrainz.org/ns/mmd-2.0#"
710  root = ET.Element("{%s}metadata" % NS)
711  rel_list = ET.SubElement(root, "{%s}release-list" % NS)
712  for release, barcode in release2barcode.items():
713  rel_xml = ET.SubElement(rel_list, "{%s}release" % NS)
714  bar_xml = ET.SubElement(rel_xml, "{%s}barcode" % NS)
715  rel_xml.set("{%s}id" % NS, release)
716  bar_xml.text = barcode
717 
718  return ET.tostring(root, "utf-8")
719 
720 def make_tag_request(**kwargs):
721  NS = "http://musicbrainz.org/ns/mmd-2.0#"
722  root = ET.Element("{%s}metadata" % NS)
723  for entity_type in ['artist', 'label', 'place', 'recording', 'release', 'release_group', 'work']:
724  entity_tags = kwargs.pop(entity_type + '_tags', None)
725  if entity_tags is not None:
726  e_list = ET.SubElement(root, "{%s}%s-list" % (NS, entity_type.replace('_', '-')))
727  for e, tags in entity_tags.items():
728  e_xml = ET.SubElement(e_list, "{%s}%s" % (NS, entity_type.replace('_', '-')))
729  e_xml.set("{%s}id" % NS, e)
730  taglist = ET.SubElement(e_xml, "{%s}user-tag-list" % NS)
731  for tag in tags:
732  usertag_xml = ET.SubElement(taglist, "{%s}user-tag" % NS)
733  name_xml = ET.SubElement(usertag_xml, "{%s}name" % NS)
734  name_xml.text = tag
735  if kwargs.keys():
736  raise TypeError("make_tag_request() got an unexpected keyword argument '%s'" % kwargs.popitem()[0])
737 
738  return ET.tostring(root, "utf-8")
739 
740 def make_rating_request(**kwargs):
741  NS = "http://musicbrainz.org/ns/mmd-2.0#"
742  root = ET.Element("{%s}metadata" % NS)
743  for entity_type in ['artist', 'label', 'recording', 'release_group', 'work']:
744  entity_ratings = kwargs.pop(entity_type + '_ratings', None)
745  if entity_ratings is not None:
746  e_list = ET.SubElement(root, "{%s}%s-list" % (NS, entity_type.replace('_', '-')))
747  for e, rating in entity_ratings.items():
748  e_xml = ET.SubElement(e_list, "{%s}%s" % (NS, entity_type.replace('_', '-')))
749  e_xml.set("{%s}id" % NS, e)
750  rating_xml = ET.SubElement(e_xml, "{%s}user-rating" % NS)
751  rating_xml.text = str(rating)
752  if kwargs.keys():
753  raise TypeError("make_rating_request() got an unexpected keyword argument '%s'" % kwargs.popitem()[0])
754 
755  return ET.tostring(root, "utf-8")
756 
757 def make_isrc_request(recording2isrcs):
758  NS = "http://musicbrainz.org/ns/mmd-2.0#"
759  root = ET.Element("{%s}metadata" % NS)
760  rec_list = ET.SubElement(root, "{%s}recording-list" % NS)
761  for rec, isrcs in recording2isrcs.items():
762  if len(isrcs) > 0:
763  rec_xml = ET.SubElement(rec_list, "{%s}recording" % NS)
764  rec_xml.set("{%s}id" % NS, rec)
765  isrc_list_xml = ET.SubElement(rec_xml, "{%s}isrc-list" % NS)
766  isrc_list_xml.set("{%s}count" % NS, str(len(isrcs)))
767  for isrc in isrcs:
768  isrc_xml = ET.SubElement(isrc_list_xml, "{%s}isrc" % NS)
769  isrc_xml.set("{%s}id" % NS, isrc)
770  return ET.tostring(root, "utf-8")
def parse_annotation(annotation)
Definition: mbxml.py:195
def parse_work(work)
Definition: mbxml.py:494
def parse_text_representation(textr)
Definition: mbxml.py:424
def parse_disc_list(dl)
Definition: mbxml.py:421
def parse_label_info(li)
Definition: mbxml.py:626
def fixtag(tag, namespaces)
Definition: mbxml.py:16
def parse_instrument_list(rl)
Definition: mbxml.py:567
def parse_artist(artist)
Definition: mbxml.py:231
def parse_series_list(sl)
Definition: mbxml.py:469
def parse_place_list(pl)
Definition: mbxml.py:261
def make_isrc_request(recording2isrcs)
Definition: mbxml.py:757
def parse_element_list(el)
Definition: mbxml.py:488
def parse_isrc(isrc)
Definition: mbxml.py:585
def get_error_message(error)
Definition: mbxml.py:39
def parse_caa(caa_element)
Definition: mbxml.py:698
def parse_release_event_list(rel)
Definition: mbxml.py:399
def parse_label_info_list(lil)
Definition: mbxml.py:619
def parse_offset_list(ol)
Definition: mbxml.py:564
def parse_url(url)
Definition: mbxml.py:529
def parse_work_attribute(wa)
Definition: mbxml.py:516
def parse_disc(disc)
Definition: mbxml.py:540
def make_artist_credit(artists)
Definition: mbxml.py:55
def parse_lifespan(lifespan)
Definition: mbxml.py:203
def parse_recording(recording)
Definition: mbxml.py:448
def parse_event_list(el)
Definition: mbxml.py:283
def parse_instrument(instrument)
Definition: mbxml.py:298
def parse_collection(collection)
Definition: mbxml.py:181
def parse_artist_list(al)
Definition: mbxml.py:228
def parse_name_credit(nc)
Definition: mbxml.py:610
def make_barcode_request(release2barcode)
Definition: mbxml.py:708
def parse_artist_credit(ac)
Definition: mbxml.py:601
def parse_area(area)
Definition: mbxml.py:211
def parse_tag_list(tl)
Definition: mbxml.py:663
def parse_external_id_list(pl)
Definition: mbxml.py:485
def parse_release_group(rg)
Definition: mbxml.py:427
def parse_tag(tag)
Definition: mbxml.py:666
def parse_place(place)
Definition: mbxml.py:264
def parse_alias_list(al)
Definition: mbxml.py:685
def parse_recording_list(recs)
Definition: mbxml.py:595
def parse_label(label)
Definition: mbxml.py:314
def parse_url_list(ul)
Definition: mbxml.py:526
def parse_work_list(wl)
Definition: mbxml.py:491
def parse_response_message(message)
Definition: mbxml.py:175
def parse_event(event)
Definition: mbxml.py:286
def parse_coordinates(c)
Definition: mbxml.py:258
def parse_label_list(ll)
Definition: mbxml.py:311
def parse_track(track)
Definition: mbxml.py:640
def parse_series(series)
Definition: mbxml.py:472
def parse_relation_list(rl)
Definition: mbxml.py:342
def parse_area_list(al)
Definition: mbxml.py:208
def make_tag_request(**kwargs)
Definition: mbxml.py:720
def parse_release_group_list(rgl)
Definition: mbxml.py:579
def parse_attributes(attributes, element)
Definition: mbxml.py:112
def parse_relation(relation)
Definition: mbxml.py:348
def parse_work_attribute_list(wal)
Definition: mbxml.py:513
def parse_elements(valid_els, inner_els, element)
Definition: mbxml.py:67
def parse_collection_list(cl)
Definition: mbxml.py:178
def parse_relation_target(tgt)
Definition: mbxml.py:335
def parse_release(release)
Definition: mbxml.py:371
def parse_cdstub(cdstub)
Definition: mbxml.py:553
def parse_release_list(rl)
Definition: mbxml.py:573
def make_rating_request(**kwargs)
Definition: mbxml.py:740
def parse_annotation_list(al)
Definition: mbxml.py:192
def parse_rating(rating)
Definition: mbxml.py:676
def parse_medium(medium)
Definition: mbxml.py:410
def parse_release_event(event)
Definition: mbxml.py:402
def parse_message(message)
Definition: mbxml.py:132
def parse_alias(alias)
Definition: mbxml.py:688
def parse_medium_list(ml)
Definition: mbxml.py:396
def parse_track_list(tl)
Definition: mbxml.py:634