/usr/share/doc/python-musicbrainzngs/html/api.html is in python-musicbrainzngs-doc 0.6-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>API — musicbrainzngs 0.6 documentation</title>
<link rel="stylesheet" href="_static//default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Usage" href="usage.html" />
</head>
<body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="usage.html" title="Usage"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">musicbrainzngs 0.6 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-musicbrainzngs">
<span id="api"></span><h1>API<a class="headerlink" href="#module-musicbrainzngs" title="Permalink to this headline">¶</a></h1>
<p>This is a shallow python binding of the MusicBrainz web service
so you should read
<a class="reference external" href="http://musicbrainz.org/doc/Development/XML Web Service/Version 2">Development/XML Web Service/Version 2</a>
to understand how that web service works in general.</p>
<p>All requests that fetch data return the data in the form of a <code class="xref py py-class docutils literal"><span class="pre">dict</span></code>.
Attributes and elements both map to keys in the dict.
List entities are of type <code class="xref py py-class docutils literal"><span class="pre">list</span></code>.</p>
<p>This part will give an overview of available functions.
Have a look at <a class="reference internal" href="usage.html"><span class="doc">Usage</span></a> for examples on how to use them.</p>
<div class="section" id="general">
<h2>General<a class="headerlink" href="#general" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="musicbrainzngs.auth">
<code class="descclassname">musicbrainzngs.</code><code class="descname">auth</code><span class="sig-paren">(</span><em>u</em>, <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.auth" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the username and password to be used in subsequent queries to
the MusicBrainz XML API that require authentication.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.set_rate_limit">
<code class="descclassname">musicbrainzngs.</code><code class="descname">set_rate_limit</code><span class="sig-paren">(</span><em>limit_or_interval=1.0</em>, <em>new_requests=1</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.set_rate_limit" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the rate limiting behavior of the module. Must be invoked
before the first Web service call.
If the <cite>limit_or_interval</cite> parameter is set to False then
rate limiting will be disabled. If it is a number then only
a set number of requests (<cite>new_requests</cite>) will be made per
given interval (<cite>limit_or_interval</cite>).</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.set_useragent">
<code class="descclassname">musicbrainzngs.</code><code class="descname">set_useragent</code><span class="sig-paren">(</span><em>app</em>, <em>version</em>, <em>contact=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.set_useragent" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the User-Agent to be used for requests to the MusicBrainz webservice.
This must be set before requests are made.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.set_hostname">
<code class="descclassname">musicbrainzngs.</code><code class="descname">set_hostname</code><span class="sig-paren">(</span><em>new_hostname</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.set_hostname" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the hostname for MusicBrainz webservice requests.
Defaults to ‘musicbrainz.org’.
You can also include a port: ‘localhost:8000’.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.set_caa_hostname">
<code class="descclassname">musicbrainzngs.</code><code class="descname">set_caa_hostname</code><span class="sig-paren">(</span><em>new_hostname</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.set_caa_hostname" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the base hostname for Cover Art Archive requests.
Defaults to ‘coverartarchive.org’.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.set_parser">
<code class="descclassname">musicbrainzngs.</code><code class="descname">set_parser</code><span class="sig-paren">(</span><em>new_parser_fun=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.set_parser" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the function used to parse the response from the
MusicBrainz web service.</p>
<p>If no parser is given, the parser is reset to the default parser
<code class="xref py py-func docutils literal"><span class="pre">mb_parser_xml()</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.set_format">
<code class="descclassname">musicbrainzngs.</code><code class="descname">set_format</code><span class="sig-paren">(</span><em>fmt='xml'</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.set_format" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the format that should be returned by the Web Service.
The server currently supports <cite>xml</cite> and <cite>json</cite>.</p>
<p>This method will set a default parser for the specified format,
but you can modify it with <a class="reference internal" href="#musicbrainzngs.set_parser" title="musicbrainzngs.set_parser"><code class="xref py py-func docutils literal"><span class="pre">set_parser()</span></code></a>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The json format used by the server is different from
the json format returned by the <cite>musicbrainzngs</cite> internal parser
when using the <cite>xml</cite> format! This format may change at any time.</p>
</div>
</dd></dl>
</div>
<div class="section" id="getting-data">
<h2>Getting Data<a class="headerlink" href="#getting-data" title="Permalink to this headline">¶</a></h2>
<p>All of these functions will fetch a MusicBrainz entity or a list of entities
as a dict.
You can specify a list of <cite>includes</cite> to get more data
and you can filter on <cite>release_status</cite> and <cite>release_type</cite>.
See <a class="reference internal" href="#musicbrainzngs.musicbrainz.VALID_RELEASE_STATUSES" title="musicbrainzngs.musicbrainz.VALID_RELEASE_STATUSES"><code class="xref py py-const docutils literal"><span class="pre">musicbrainz.VALID_RELEASE_STATUSES</span></code></a>
and <a class="reference internal" href="#musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES" title="musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES"><code class="xref py py-const docutils literal"><span class="pre">musicbrainz.VALID_RELEASE_TYPES</span></code></a>.
The valid includes are listed for each function.</p>
<dl class="function">
<dt id="musicbrainzngs.get_area_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_area_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_area_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the area with the MusicBrainz <cite>id</cite> as a dict with an ‘area’ key.</p>
<p><em>Available includes</em>: aliases, annotation, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_artist_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_artist_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_artist_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the artist with the MusicBrainz <cite>id</cite> as a dict with an ‘artist’ key.</p>
<p><em>Available includes</em>: recordings, releases, release-groups, works, various-artists, discids, media, isrcs, aliases, annotation, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels, tags, user-tags, ratings, user-ratings</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_event_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_event_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_event_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the event with the MusicBrainz <cite>id</cite> as a dict with an ‘event’ key.</p>
<p>The event dict has the following keys:
<cite>id</cite>, <cite>type</cite>, <cite>name</cite>, <cite>time</cite>, <cite>disambiguation</cite> and <cite>life-span</cite>.</p>
<p><em>Available includes</em>: aliases, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels, tags, user-tags, ratings, user-ratings</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_instrument_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_instrument_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_instrument_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the instrument with the MusicBrainz <cite>id</cite> as a dict with an ‘artist’ key.</p>
<p><em>Available includes</em>: aliases, annotation, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels, tags, user-tags</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_label_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_label_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_label_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the label with the MusicBrainz <cite>id</cite> as a dict with a ‘label’ key.</p>
<p><em>Available includes</em>: releases, discids, media, aliases, annotation, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels, tags, user-tags, ratings, user-ratings</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_place_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_place_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_place_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the place with the MusicBrainz <cite>id</cite> as a dict with an ‘place’ key.</p>
<p><em>Available includes</em>: aliases, annotation, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels, tags, user-tags</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_recording_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_recording_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_recording_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the recording with the MusicBrainz <cite>id</cite> as a dict
with a ‘recording’ key.</p>
<p><em>Available includes</em>: artists, releases, discids, media, artist-credits, isrcs, annotation, aliases, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_recordings_by_isrc">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_recordings_by_isrc</code><span class="sig-paren">(</span><em>isrc</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_recordings_by_isrc" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for recordings with an <a class="reference external" href="http://musicbrainz.org/doc/ISRC">ISRC</a>.
The result is a dict with an ‘isrc’ key,
which again includes a ‘recording-list’.</p>
<p><em>Available includes</em>: artists, releases, discids, media, artist-credits, isrcs, annotation, aliases, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_release_group_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_release_group_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_release_group_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the release group with the MusicBrainz <cite>id</cite> as a dict
with a ‘release-group’ key.</p>
<p><em>Available includes</em>: artists, releases, discids, media, artist-credits, annotation, aliases, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_release_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_release_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>release_status=[]</em>, <em>release_type=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_release_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the release with the MusicBrainz <cite>id</cite> as a dict with a ‘release’ key.</p>
<p><em>Available includes</em>: artists, labels, recordings, release-groups, media, artist-credits, discids, isrcs, recording-level-rels, work-level-rels, annotation, aliases, tags, user-tags, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_releases_by_discid">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_releases_by_discid</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em>, <em>toc=None</em>, <em>cdstubs=True</em>, <em>media_format=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_releases_by_discid" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for releases with a <a class="reference external" href="http://musicbrainz.org/doc/Disc ID">Disc ID</a> or table of contents.</p>
<p>When a <cite>toc</cite> is provided and no release with the disc ID is found,
a fuzzy search by the toc is done.
The <cite>toc</cite> should have to same format as <code class="xref py py-attr docutils literal"><span class="pre">discid.Disc.toc_string</span></code>.
When a <cite>toc</cite> is provided, the format of the discid itself is not
checked server-side, so any value may be passed if searching by only
<cite>toc</cite> is desired.</p>
<p>If no toc matches in musicbrainz but a <a class="reference external" href="http://musicbrainz.org/doc/CD Stub">CD Stub</a> does,
the CD Stub will be returned. Prevent this from happening by
passing <cite>cdstubs=False</cite>.</p>
<p>By default only results that match a format that allows discids
(e.g. CD) are included. To include all media formats, pass
<cite>media_format=’all’</cite>.</p>
<p>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.</p>
<p><em>Available includes</em>: artists, labels, recordings, release-groups, media, artist-credits, discids, isrcs, recording-level-rels, work-level-rels, annotation, aliases, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_series_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_series_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_series_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the series with the MusicBrainz <cite>id</cite> as a dict with a ‘series’ key.</p>
<p><em>Available includes</em>: annotation, aliases, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_work_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_work_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_work_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the work with the MusicBrainz <cite>id</cite> as a dict with a ‘work’ key.</p>
<p><em>Available includes</em>: artists, aliases, annotation, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_works_by_iswc">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_works_by_iswc</code><span class="sig-paren">(</span><em>iswc</em>, <em>includes=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_works_by_iswc" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for works with an <a class="reference external" href="http://musicbrainz.org/doc/ISWC">ISWC</a>.
The result is a dict with a`work-list`.</p>
<p><em>Available includes</em>: artists, aliases, annotation, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_url_by_id">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_url_by_id</code><span class="sig-paren">(</span><em>id</em>, <em>includes=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_url_by_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the url with the MusicBrainz <cite>id</cite> as a dict with a ‘url’ key.</p>
<p><em>Available includes</em>: area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_collections">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_collections</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_collections" title="Permalink to this definition">¶</a></dt>
<dd><p>List the collections for the currently <a class="reference internal" href="#musicbrainzngs.auth" title="musicbrainzngs.auth"><code class="xref py py-func docutils literal"><span class="pre">authenticated</span></code></a> user
as a dict with a ‘collection-list’ key.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_releases_in_collection">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_releases_in_collection</code><span class="sig-paren">(</span><em>collection</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_releases_in_collection" title="Permalink to this definition">¶</a></dt>
<dd><p>List the releases in a collection.
Returns a dict with a ‘collection’ key, which again has a ‘release-list’.</p>
<p>See <a class="reference internal" href="#browsing">Browsing</a> for how to use <cite>limit</cite> and <cite>offset</cite>.</p>
</dd></dl>
<dl class="data">
<dt id="musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES">
<code class="descclassname">musicbrainzngs.musicbrainz.</code><code class="descname">VALID_RELEASE_TYPES</code><em class="property"> = ['nat', 'album', 'single', 'ep', 'broadcast', 'other', 'compilation', 'soundtrack', 'spokenword', 'interview', 'audiobook', 'live', 'remix', 'dj-mix', 'mixtape/street']</em><a class="headerlink" href="#musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES" title="Permalink to this definition">¶</a></dt>
<dd><p>These can be used to filter whenever releases are includes or browsed</p>
</dd></dl>
<dl class="data">
<dt id="musicbrainzngs.musicbrainz.VALID_RELEASE_STATUSES">
<code class="descclassname">musicbrainzngs.musicbrainz.</code><code class="descname">VALID_RELEASE_STATUSES</code><em class="property"> = ['official', 'promotion', 'bootleg', 'pseudo-release']</em><a class="headerlink" href="#musicbrainzngs.musicbrainz.VALID_RELEASE_STATUSES" title="Permalink to this definition">¶</a></dt>
<dd><p>These can be used to filter whenever releases or release-groups are involved</p>
</dd></dl>
</div>
<div class="section" id="cover-art">
<span id="caa-api"></span><h2>Cover Art<a class="headerlink" href="#cover-art" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="musicbrainzngs.get_image_list">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_image_list</code><span class="sig-paren">(</span><em>releaseid</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_image_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the list of cover art associated with a release.</p>
<p>The return value is the deserialized response of the <a class="reference external" href="http://musicbrainz.org/doc/Cover_Art_Archive/API#.2Frelease.2F.7Bmbid.7D.2F">JSON listing</a>
returned by the Cover Art Archive API.</p>
<p>If an error occurs then a <a class="reference internal" href="#musicbrainzngs.ResponseError" title="musicbrainzngs.ResponseError"><code class="xref py py-class docutils literal"><span class="pre">ResponseError</span></code></a> will
be raised with one of the following HTTP codes:</p>
<ul class="simple">
<li>400: <cite>Releaseid</cite> is not a valid UUID</li>
<li>404: No release exists with an MBID of <cite>releaseid</cite></li>
<li>503: Ratelimit exceeded</li>
</ul>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_release_group_image_list">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_release_group_image_list</code><span class="sig-paren">(</span><em>releasegroupid</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_release_group_image_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the list of cover art associated with a release group.</p>
<p>The return value is the deserialized response of the <a class="reference external" href="http://musicbrainz.org/doc/Cover_Art_Archive/API#.2Frelease-group.2F.7Bmbid.7D.2F">JSON listing</a>
returned by the Cover Art Archive API.</p>
<p>If an error occurs then a <a class="reference internal" href="#musicbrainzngs.ResponseError" title="musicbrainzngs.ResponseError"><code class="xref py py-class docutils literal"><span class="pre">ResponseError</span></code></a> will
be raised with one of the following HTTP codes:</p>
<ul class="simple">
<li>400: <cite>Releaseid</cite> is not a valid UUID</li>
<li>404: No release exists with an MBID of <cite>releaseid</cite></li>
<li>503: Ratelimit exceeded</li>
</ul>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_image">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_image</code><span class="sig-paren">(</span><em>mbid</em>, <em>coverid</em>, <em>size=None</em>, <em>entitytype='release'</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_image" title="Permalink to this definition">¶</a></dt>
<dd><p>Download cover art for a release. The coverart file to download
is specified by the <cite>coverid</cite> argument.</p>
<p>If <cite>size</cite> is not specified, download the largest copy present, which can be
very large.</p>
<p>If an error occurs then a <a class="reference internal" href="#musicbrainzngs.ResponseError" title="musicbrainzngs.ResponseError"><code class="xref py py-class docutils literal"><span class="pre">ResponseError</span></code></a>
will be raised with one of the following HTTP codes:</p>
<ul class="simple">
<li>400: <cite>Releaseid</cite> is not a valid UUID or <cite>coverid</cite> is invalid</li>
<li>404: No release exists with an MBID of <cite>releaseid</cite></li>
<li>503: Ratelimit exceeded</li>
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>coverid</strong> (<em>int</em><em> or </em><em>str</em>) – <code class="docutils literal"><span class="pre">front</span></code>, <code class="docutils literal"><span class="pre">back</span></code> or a number from the listing obtained with
<a class="reference internal" href="#musicbrainzngs.get_image_list" title="musicbrainzngs.get_image_list"><code class="xref py py-meth docutils literal"><span class="pre">get_image_list()</span></code></a></li>
<li><strong>size</strong> (<em>str</em><em> or </em><em>None</em>) – 250, 500 or None. If it is None, the largest available picture
will be downloaded. If the image originally uploaded to the
Cover Art Archive was smaller than the requested size, only
the original image will be returned.</li>
<li><strong>entitytype</strong> (<em>str</em>) – The type of entity for which to download the cover art.
This is either <code class="docutils literal"><span class="pre">release</span></code> or <code class="docutils literal"><span class="pre">release-group</span></code>.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The binary image data</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><p class="first last">str</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_image_front">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_image_front</code><span class="sig-paren">(</span><em>releaseid</em>, <em>size=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_image_front" title="Permalink to this definition">¶</a></dt>
<dd><p>Download the front cover art for a release.
The <cite>size</cite> argument and the possible error conditions are the same as for
<a class="reference internal" href="#musicbrainzngs.get_image" title="musicbrainzngs.get_image"><code class="xref py py-meth docutils literal"><span class="pre">get_image()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_release_group_image_front">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_release_group_image_front</code><span class="sig-paren">(</span><em>releasegroupid</em>, <em>size=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_release_group_image_front" title="Permalink to this definition">¶</a></dt>
<dd><p>Download the front cover art for a release group.
The <cite>size</cite> argument and the possible error conditions are the same as for
<a class="reference internal" href="#musicbrainzngs.get_image" title="musicbrainzngs.get_image"><code class="xref py py-meth docutils literal"><span class="pre">get_image()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.get_image_back">
<code class="descclassname">musicbrainzngs.</code><code class="descname">get_image_back</code><span class="sig-paren">(</span><em>releaseid</em>, <em>size=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.get_image_back" title="Permalink to this definition">¶</a></dt>
<dd><p>Download the back cover art for a release.
The <cite>size</cite> argument and the possible error conditions are the same as for
<a class="reference internal" href="#musicbrainzngs.get_image" title="musicbrainzngs.get_image"><code class="xref py py-meth docutils literal"><span class="pre">get_image()</span></code></a>.</p>
</dd></dl>
</div>
<div class="section" id="searching">
<span id="search-api"></span><h2>Searching<a class="headerlink" href="#searching" title="Permalink to this headline">¶</a></h2>
<p>For all of these search functions you can use any of the allowed search fields
as parameter names.
The documentation of what these fields do is on
<a class="reference external" href="http://musicbrainz.org/doc/Development/XML Web Service/Version 2/Search">Development/XML Web Service/Version 2/Search</a>.</p>
<p>You can also set the <cite>query</cite> parameter to any lucene query you like.
When you use any of the search fields as parameters,
special characters are escaped in the <cite>query</cite>.</p>
<p>By default the elements are concatenated with spaces in between,
so lucene essentially does a fuzzy search.
That search might include results that don’t match the complete query,
though these will be ranked lower than the ones that do.
If you want all query elements to match for all results,
you have to set <cite>strict=True</cite>.</p>
<p>By default the web service returns 25 results per request and you can set
a <cite>limit</cite> of up to 100.
You have to use the <cite>offset</cite> parameter to set how many results you have
already seen so the web service doesn’t give you the same results again.</p>
<dl class="function">
<dt id="musicbrainzngs.search_annotations">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_annotations</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_annotations" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for annotations and return a dict with an ‘annotation-list’ key.</p>
<p><em>Available search fields</em>: entity, name, text, type</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_areas">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_areas</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_areas" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for areas and return a dict with an ‘area-list’ key.</p>
<p><em>Available search fields</em>: aid, area, alias, begin, comment, end, ended, iso, iso1, iso2, iso3, type</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_artists">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_artists</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_artists" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for artists and return a dict with an ‘artist-list’ key.</p>
<p><em>Available search fields</em>: arid, artist, artistaccent, alias, begin, comment, country, end, ended, gender, ipi, sortname, tag, type, area, beginarea, endarea</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_events">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_events</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_events" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for events and return a dict with an ‘event-list’ key.</p>
<p><em>Available search fields</em>:</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_instruments">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_instruments</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_instruments" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for instruments and return a dict with a ‘instrument-list’ key.</p>
<p><em>Available search fields</em>:</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_labels">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_labels</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_labels" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for labels and return a dict with a ‘label-list’ key.</p>
<p><em>Available search fields</em>: alias, begin, code, comment, country, end, ended, ipi, label, labelaccent, laid, sortname, type, tag, area</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_places">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_places</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_places" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for places and return a dict with a ‘place-list’ key.</p>
<p><em>Available search fields</em>:</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_recordings">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_recordings</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_recordings" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for recordings and return a dict with a ‘recording-list’ key.</p>
<p><em>Available search fields</em>: arid, artist, artistname, creditname, comment, country, date, dur, format, isrc, number, position, primarytype, puid, qdur, recording, recordingaccent, reid, release, rgid, rid, secondarytype, status, tnum, tracks, tracksrelease, tag, type, video</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_release_groups">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_release_groups</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_release_groups" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for release groups and return a dict
with a ‘release-group-list’ key.</p>
<p><em>Available search fields</em>: arid, artist, artistname, comment, creditname, primarytype, rgid, releasegroup, releasegroupaccent, releases, release, reid, secondarytype, status, tag, type</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_releases">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_releases</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_releases" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for recordings and return a dict with a ‘recording-list’ key.</p>
<p><em>Available search fields</em>: arid, artist, artistname, asin, barcode, creditname, catno, comment, country, creditname, date, discids, discidsmedium, format, laid, label, lang, mediums, primarytype, puid, quality, reid, release, releaseaccent, rgid, script, secondarytype, status, tag, tracks, tracksmedium, type</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_series">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_series</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_series" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for series and return a dict with a ‘series-list’ key.</p>
<p><em>Available search fields</em>: alias, comment, sid, series, type</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.search_works">
<code class="descclassname">musicbrainzngs.</code><code class="descname">search_works</code><span class="sig-paren">(</span><em>query=''</em>, <em>limit=None</em>, <em>offset=None</em>, <em>strict=False</em>, <em>**fields</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.search_works" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for works and return a dict with a ‘work-list’ key.</p>
<p><em>Available search fields</em>: alias, arid, artist, comment, iswc, lang, tag, type, wid, work, workaccent</p>
</dd></dl>
</div>
<div class="section" id="browsing">
<h2>Browsing<a class="headerlink" href="#browsing" title="Permalink to this headline">¶</a></h2>
<p>You can browse entitities of a certain type linked to one specific entity.
That is you can browse all recordings by an artist, for example.</p>
<p>These functions can be used to to include more than the maximum of 25 linked
entities returned by the functions in <a class="reference internal" href="#getting-data">Getting Data</a>.
You can set a <cite>limit</cite> as high as 100. The default is still 25.
Similar to the functions in <a class="reference internal" href="#searching">Searching</a>, you have to specify
an <cite>offset</cite> to see the results you haven’t seen yet.</p>
<p>You have to provide exactly one MusicBrainz ID to these functions.</p>
<dl class="function">
<dt id="musicbrainzngs.browse_artists">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_artists</code><span class="sig-paren">(</span><em>recording=None</em>, <em>release=None</em>, <em>release_group=None</em>, <em>work=None</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_artists" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all artists linked to a recording, a release or a release group.
You need to give one MusicBrainz ID.</p>
<p><em>Available includes</em>: aliases, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.browse_events">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_events</code><span class="sig-paren">(</span><em>area=None</em>, <em>artist=None</em>, <em>place=None</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_events" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all events linked to a area, a artist or a place.
You need to give one MusicBrainz ID.</p>
<p><em>Available includes</em>: aliases, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.browse_labels">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_labels</code><span class="sig-paren">(</span><em>release=None</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_labels" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all labels linked to a relase. You need to give a MusicBrainz ID.</p>
<p><em>Available includes</em>: aliases, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.browse_places">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_places</code><span class="sig-paren">(</span><em>area=None</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_places" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all places linked to an area. You need to give a MusicBrainz ID.</p>
<p><em>Available includes</em>: aliases, tags, user-tags, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.browse_recordings">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_recordings</code><span class="sig-paren">(</span><em>artist=None</em>, <em>release=None</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_recordings" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all recordings linked to an artist or a release.
You need to give one MusicBrainz ID.</p>
<p><em>Available includes</em>: artist-credits, isrcs, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.browse_release_groups">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_release_groups</code><span class="sig-paren">(</span><em>artist=None</em>, <em>release=None</em>, <em>release_type=[]</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_release_groups" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all release groups linked to an artist or a release.
You need to give one MusicBrainz ID.</p>
<p>You can filter by <a class="reference internal" href="#musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES" title="musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES"><code class="xref py py-data docutils literal"><span class="pre">musicbrainz.VALID_RELEASE_TYPES</span></code></a>.</p>
<p><em>Available includes</em>: artist-credits, tags, user-tags, ratings, user-ratings, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.browse_releases">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_releases</code><span class="sig-paren">(</span><em>artist=None</em>, <em>track_artist=None</em>, <em>label=None</em>, <em>recording=None</em>, <em>release_group=None</em>, <em>release_status=[]</em>, <em>release_type=[]</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_releases" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all releases linked to an artist, a label, a recording
or a release group. You need to give one MusicBrainz ID.</p>
<p>You can also browse by <cite>track_artist</cite>, which gives all releases where some
tracks are attributed to that artist, but not the whole release.</p>
<p>You can filter by <a class="reference internal" href="#musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES" title="musicbrainzngs.musicbrainz.VALID_RELEASE_TYPES"><code class="xref py py-data docutils literal"><span class="pre">musicbrainz.VALID_RELEASE_TYPES</span></code></a> or
<a class="reference internal" href="#musicbrainzngs.musicbrainz.VALID_RELEASE_STATUSES" title="musicbrainzngs.musicbrainz.VALID_RELEASE_STATUSES"><code class="xref py py-data docutils literal"><span class="pre">musicbrainz.VALID_RELEASE_STATUSES</span></code></a>.</p>
<p><em>Available includes</em>: artist-credits, labels, recordings, isrcs, release-groups, media, discids, area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.browse_urls">
<code class="descclassname">musicbrainzngs.</code><code class="descname">browse_urls</code><span class="sig-paren">(</span><em>resource=None</em>, <em>includes=[]</em>, <em>limit=None</em>, <em>offset=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.browse_urls" title="Permalink to this definition">¶</a></dt>
<dd><p>Get urls by actual URL string.
You need to give a URL string as ‘resource’</p>
<p><em>Available includes</em>: area-rels, artist-rels, label-rels, place-rels, event-rels, recording-rels, release-rels, release-group-rels, series-rels, url-rels, work-rels, instrument-rels</p>
</dd></dl>
</div>
<div class="section" id="submitting">
<span id="api-submitting"></span><h2>Submitting<a class="headerlink" href="#submitting" title="Permalink to this headline">¶</a></h2>
<p>These are the only functions that write to the MusicBrainz database.
They take one or more dicts with multiple entities as keys,
which take certain values or a list of values.</p>
<p>You have to use <a class="reference internal" href="#musicbrainzngs.auth" title="musicbrainzngs.auth"><code class="xref py py-func docutils literal"><span class="pre">auth()</span></code></a> before using any of these functions.</p>
<dl class="function">
<dt id="musicbrainzngs.submit_barcodes">
<code class="descclassname">musicbrainzngs.</code><code class="descname">submit_barcodes</code><span class="sig-paren">(</span><em>release_barcode</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.submit_barcodes" title="Permalink to this definition">¶</a></dt>
<dd><p>Submits a set of {release_id1: barcode, …}</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.submit_isrcs">
<code class="descclassname">musicbrainzngs.</code><code class="descname">submit_isrcs</code><span class="sig-paren">(</span><em>recording_isrcs</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.submit_isrcs" title="Permalink to this definition">¶</a></dt>
<dd><p>Submit ISRCs.
Submits a set of {recording-id1: [isrc1, …], …}
or {recording_id1: isrc, …}.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.submit_tags">
<code class="descclassname">musicbrainzngs.</code><code class="descname">submit_tags</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.submit_tags" title="Permalink to this definition">¶</a></dt>
<dd><p>Submit user tags.
Takes parameters named e.g. ‘artist_tags’, ‘recording_tags’, etc.,
and of the form:
{entity_id1: [tag1, …], …}
If you only have one tag for an entity you can use a string instead
of a list.</p>
<p>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.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.submit_ratings">
<code class="descclassname">musicbrainzngs.</code><code class="descname">submit_ratings</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.submit_ratings" title="Permalink to this definition">¶</a></dt>
<dd><p>Submit user ratings.
Takes parameters named e.g. ‘artist_ratings’, ‘recording_ratings’, etc.,
and of the form:
{entity_id1: rating, …}</p>
<p>Ratings are numbers from 0-100, at intervals of 20 (20 per ‘star’).
Submitting a rating of 0 will remove the user’s rating.</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.add_releases_to_collection">
<code class="descclassname">musicbrainzngs.</code><code class="descname">add_releases_to_collection</code><span class="sig-paren">(</span><em>collection</em>, <em>releases=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.add_releases_to_collection" title="Permalink to this definition">¶</a></dt>
<dd><p>Add releases to a collection.
Collection and releases should be identified by their MBIDs</p>
</dd></dl>
<dl class="function">
<dt id="musicbrainzngs.remove_releases_from_collection">
<code class="descclassname">musicbrainzngs.</code><code class="descname">remove_releases_from_collection</code><span class="sig-paren">(</span><em>collection</em>, <em>releases=[]</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.remove_releases_from_collection" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove releases from a collection.
Collection and releases should be identified by their MBIDs</p>
</dd></dl>
</div>
<div class="section" id="exceptions">
<h2>Exceptions<a class="headerlink" href="#exceptions" title="Permalink to this headline">¶</a></h2>
<p>These are the main exceptions that are raised by functions in musicbrainzngs.
You might want to catch some of these at an appropriate point in your code.</p>
<p>Some of these might have subclasses that are not listed here.</p>
<dl class="class">
<dt id="musicbrainzngs.MusicBrainzError">
<em class="property">class </em><code class="descclassname">musicbrainzngs.</code><code class="descname">MusicBrainzError</code><a class="headerlink" href="#musicbrainzngs.MusicBrainzError" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for all exceptions related to MusicBrainz.</p>
</dd></dl>
<dl class="class">
<dt id="musicbrainzngs.UsageError">
<em class="property">class </em><code class="descclassname">musicbrainzngs.</code><code class="descname">UsageError</code><a class="headerlink" href="#musicbrainzngs.UsageError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">musicbrainzngs.musicbrainz.MusicBrainzError</span></code></p>
<p>Error related to misuse of the module API.</p>
</dd></dl>
<dl class="class">
<dt id="musicbrainzngs.WebServiceError">
<em class="property">class </em><code class="descclassname">musicbrainzngs.</code><code class="descname">WebServiceError</code><span class="sig-paren">(</span><em>message=None</em>, <em>cause=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.WebServiceError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">musicbrainzngs.musicbrainz.MusicBrainzError</span></code></p>
<p>Error related to MusicBrainz API requests.</p>
</dd></dl>
<dl class="class">
<dt id="musicbrainzngs.AuthenticationError">
<em class="property">class </em><code class="descclassname">musicbrainzngs.</code><code class="descname">AuthenticationError</code><span class="sig-paren">(</span><em>message=None</em>, <em>cause=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.AuthenticationError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">musicbrainzngs.musicbrainz.WebServiceError</span></code></p>
<p>Received a HTTP 401 response while accessing a protected resource.</p>
</dd></dl>
<dl class="class">
<dt id="musicbrainzngs.NetworkError">
<em class="property">class </em><code class="descclassname">musicbrainzngs.</code><code class="descname">NetworkError</code><span class="sig-paren">(</span><em>message=None</em>, <em>cause=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.NetworkError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">musicbrainzngs.musicbrainz.WebServiceError</span></code></p>
<p>Problem communicating with the MB server.</p>
</dd></dl>
<dl class="class">
<dt id="musicbrainzngs.ResponseError">
<em class="property">class </em><code class="descclassname">musicbrainzngs.</code><code class="descname">ResponseError</code><span class="sig-paren">(</span><em>message=None</em>, <em>cause=None</em><span class="sig-paren">)</span><a class="headerlink" href="#musicbrainzngs.ResponseError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">musicbrainzngs.musicbrainz.WebServiceError</span></code></p>
<p>Bad response sent by the MB server.</p>
</dd></dl>
</div>
<div class="section" id="logging">
<h2>Logging<a class="headerlink" href="#logging" title="Permalink to this headline">¶</a></h2>
<p><cite>musicbrainzngs</cite> logs debug and informational messages using Python’s
<code class="xref py py-mod docutils literal"><span class="pre">logging</span></code> module.
All logging is done in the logger with the name <cite>musicbrainzngs</cite>.</p>
<p>You can enable this output in your application with:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">logging</span>
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">)</span>
<span class="c1"># optionally restrict musicbrainzngs output to INFO messages</span>
<span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"musicbrainzngs"</span><span class="p">)</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">API</a><ul>
<li><a class="reference internal" href="#general">General</a></li>
<li><a class="reference internal" href="#getting-data">Getting Data</a></li>
<li><a class="reference internal" href="#cover-art">Cover Art</a></li>
<li><a class="reference internal" href="#searching">Searching</a></li>
<li><a class="reference internal" href="#browsing">Browsing</a></li>
<li><a class="reference internal" href="#submitting">Submitting</a></li>
<li><a class="reference internal" href="#exceptions">Exceptions</a></li>
<li><a class="reference internal" href="#logging">Logging</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="usage.html"
title="previous chapter">Usage</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="usage.html" title="Usage"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">musicbrainzngs 0.6 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2018, Alastair Porter et al.
Last updated on February 19, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.7.
</div>
</body>
</html>
|