# Script for printing collections

**URL:** <https://community.metabrainz.org/t/script-for-printing-collections/521437>\
**Category:** MusicBrainz\
**Created:** [February 27, 2021, 3:47am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437 "2021-02-27T03:47:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lytninb](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/l/a5b964/32.png) [@lytninb](https://community.metabrainz.org/u/lytninb)\
**Post date:** [February 27, 2021, 3:47am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/1 "2021-02-27T03:47:21Z")

</div>

Okay , I’ve searched and was unable to find anything close to this question so here it is. Does anyone know of a script or something similar to where I can print my collection that I have on MB? I’d like to arrange my physical collection from A to Z and thought it would be easier with something like this.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ulugabi](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ulugabi/32/41181_2.png) [@ulugabi](https://community.metabrainz.org/u/ulugabi)\
**Post date:** [February 27, 2021, 5:17am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/2 "2021-02-27T05:17:52Z")

</div>

You mean exporting all the releases with Artist + Title?

---

<div class="post-metadata">

**Author:** ![aerozol](https://community.metabrainz.org/user_avatar/community.metabrainz.org/aerozol/32/116_2.png) [@aerozol](https://community.metabrainz.org/u/aerozol)\
**Post date:** [February 27, 2021, 9:01pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/3 "2021-02-27T21:01:19Z")

</div>

What a cool idea… I’m guessing you mean these pages:  
[https://musicbrainz.org/user/aerozol/collections](https://musicbrainz.org/user/aerozol/collections)

I wonder if this would be worth a feature request?

---

<div class="post-metadata">

**Author:** ![lytninb](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/l/a5b964/32.png) [@lytninb](https://community.metabrainz.org/u/lytninb)\
**Post date:** [February 28, 2021, 2:04am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/4 "2021-02-28T02:04:45Z")

</div>

Yes, in a nice printed page A to Z.

---

<div class="post-metadata">

**Author:** ![lytninb](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/l/a5b964/32.png) [@lytninb](https://community.metabrainz.org/u/lytninb)\
**Post date:** [February 28, 2021, 2:05am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/5 "2021-02-28T02:05:10Z")

</div>

Yes, so we can print our collection out.

---

<div class="post-metadata">

**Author:** ![ulugabi](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ulugabi/32/41181_2.png) [@ulugabi](https://community.metabrainz.org/u/ulugabi)\
**Post date:** [February 28, 2021, 3:08am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/6 "2021-02-28T03:08:02Z")

</div>

> [@aerozol](#):
>
> I wonder if this would be worth a feature request?

Wonder too as:

- Data is already available (with some IT knwoledge)
- Formatting is user dependant

You could request something more generic in order it serves more users.  
ex: able to export tables in csv

---

<div class="post-metadata">

**Author:** ![IvanDobsky](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ivandobsky/32/11785_2.png) [@IvanDobsky](https://community.metabrainz.org/u/IvanDobsky)\
**Post date:** [February 28, 2021, 9:59am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/7 "2021-02-28T09:59:55Z")

</div>

> [@ulugabi](#):
>
> ex: able to export tables in csv

This option x 100. Currently I am limited to a copy\paste of the screen and dump it into notepad++ for formatting

Imagine if a bored Database scripter came up with a script that could also add other columns like MBID to that CSV.

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [February 28, 2021, 10:37am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/8 "2021-02-28T10:37:25Z")

</div>

I made a printing-friendly user CSS for collection with a JavaScript to append all pages together on one page, make a big long table.

But.

I don’t find them back.  
They may ot have been compatible with current MBS because after that, I made the [COLLECTION HIGHLIGHTER](https://github.com/jesus2099/konami-command/blob/master/mb_COLLECTION-HIGHLIGHTER.user.js) to workaround [MBS-3491](https://tickets.metabrainz.org/browse/MBS-3491) instead.

But now that extension support is threatened on Android (only Firefox 68), I am interested again.

---

<div class="post-metadata">

**Author:** ![kellnerd](https://community.metabrainz.org/user_avatar/community.metabrainz.org/kellnerd/32/66963_2.png) [@kellnerd](https://community.metabrainz.org/u/kellnerd)\
**Post date:** [February 28, 2021, 11:49am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/9 "2021-02-28T11:49:35Z")

</div>

You can get a list of releases in a collection in JSON (or XML) using the [API](https://musicbrainz.org/doc/MusicBrainz_API#collections).  
Using one of @aerozol’s public collections as example (because they are already linked in this thread) [https://beta.musicbrainz.org/ws/2/release?collection=cd8e0a8d-437a-4c1b-b808-60f37ba00c14&inc=artist-credits+labels&fmt=json](https://beta.musicbrainz.org/ws/2/release?collection=cd8e0a8d-437a-4c1b-b808-60f37ba00c14&inc=artist-credits+labels&fmt=json) is probably a good start.  
It should be relatively easy to transform this into CSV with a userscript if this is the format most people would like to have, maybe I will give it a try (but I can not promise it). Or is @jesus2099 already coding something fancy?

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [February 28, 2021, 12:14pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/10 "2021-02-28T12:14:54Z")

</div>

Oh I will not try to redo my website based script as you are right, we should do with the API, it is far more maintainable.  
I have a problem of time.  
I won’t work on this anytime soon but will most certainly use the feature a lot, if someone makes it!

---

<div class="post-metadata">

**Author:** ![biocv](https://community.metabrainz.org/user_avatar/community.metabrainz.org/biocv/32/25412_2.png) [@biocv](https://community.metabrainz.org/u/biocv)\
**Post date:** [February 28, 2021, 12:44pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/11 "2021-02-28T12:44:05Z")

</div>

> [@kellnerd](#):
>
> You can get a list of releases in a collection in JSON (or XML) using the API.

Seconded. This worked fine for me. I wrote some python code using the [requests library](https://requests.readthedocs.io/en/master/) to import my collection in JSON format. After that, it was relatively straightforward to convert to a csv file.

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [February 28, 2021, 12:59pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/12 "2021-02-28T12:59:30Z")

</div>

I remember Excel files are always a challenge to make things inside the printing zone and correct multipaging, no?

Maybe I will eventually try to redo my CSS with _endless loading_… When I have some time. Don’t count on me.

---

<div class="post-metadata">

**Author:** ![ulugabi](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ulugabi/32/41181_2.png) [@ulugabi](https://community.metabrainz.org/u/ulugabi)\
**Post date:** [February 28, 2021, 1:23pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/13 "2021-02-28T13:23:55Z")

</div>

> [@IvanDobsky](#):
>
> > [@ulugabi](#):
> >
> > ex: able to export tables in csv
> 
> This option x 100. Currently I am limited to a copy\paste of the screen and dump it into notepad++ for formatting
> 
> Imagine if a bored Database scripter came up with a script that could also add other columns like MBID to that CSV.

If you want the MBID you can already do a right click/view source code of page rather than copy paste into notepad 😛

---

<div class="post-metadata">

**Author:** ![IvanDobsky](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ivandobsky/32/11785_2.png) [@IvanDobsky](https://community.metabrainz.org/u/IvanDobsky)\
**Post date:** [February 28, 2021, 5:05pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/14 "2021-02-28T17:05:48Z")

</div>

> [@jesus2099](#):
>
> I remember Excel files are always a challenge to make things inside the printing zone and correct multipaging, no

CSV is just plain text. Comma Separated Text. Nothing as complex as Excel.

> [@ulugabi](#):
>
> If you want the MBID you can already do a right click/view source code

The trick I do is to copy\paste into OneNote. It gives a nice clean table without any cleaning up needed. But then I realise not many people use OneNote.

Haha - I just looked at “view page source” and got one long line of text without even a line feed!

A simple, dumb, export to plain text file would be such a useful addition. This is another place where MB needs to nick more ideas from Discogs as their Collection has an export to CSV option.

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [February 28, 2021, 6:12pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/15 "2021-02-28T18:12:01Z")

</div>

I would prefer a printable page, like the OP.

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [February 28, 2021, 7:17pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/16 "2021-02-28T19:17:06Z")

</div>

> [@jesus2099](#):
>
> Maybe I will eventually try to redo my CSS with _endless loading_… When I have some time. Don’t count on me.

Apparently for some versions of Chromium browsers, one would have to add [a strange workaround](https://stackoverflow.com/questions/274149/repeat-table-headers-in-print-mode#comment67561622_274161) for it to repeat table headers on each printed page (that other browsers do genuinely).

```css
div#content table.tbl > thead > th { break-inside: avoid; }

```

To be verified.

---

<div class="post-metadata">

**Author:** ![aerozol](https://community.metabrainz.org/user_avatar/community.metabrainz.org/aerozol/32/116_2.png) [@aerozol](https://community.metabrainz.org/u/aerozol)\
**Post date:** [March 1, 2021, 10:16pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/17 "2021-03-01T22:16:48Z")

</div>

> [@kellnerd](#):
>
> userscript if this is the format most people would like to have

I heart userscripts, but everything’s better when embedded into the product imo!

So, even if it’s unlikely:

> <https://tickets.metabrainz.org/browse/MBS-11418>

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [March 2, 2021, 12:28pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/18 "2021-03-02T12:28:50Z")

</div>

⚠ It still does not load the full collection.

> <https://github.com/jesus2099/konami-command/blob/master/mb_PRINT-ALL-PAGES.user.js>

  
At the moment, I have just done the basic `css` for print.  
I still need to copy my page loader from mb\_COLLECTION-HIGHLIGHTER.  
It should not be long but I am busy now.  
And I thought also of having a checkbox toolbar at the top, to unselect the columns you don’t want to print.  
And maybe never print label disambiguation comments.

Before installing it, go to your collection first page and press **Ctrl+P** or **Ctrl+Shift+P** to preview print.

Then install it ( **Raw** button in GitHub), go to your collection first page, click the yellow button, then preview print again, to see the difference.

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [March 8, 2021, 11:51pm UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/19 "2021-03-08T23:51:40Z")

</div>

Now [my script](https://github.com/jesus2099/konami-command/blob/master/mb_PRINT-ALL-PAGES.user.js) is fully functional on collections.

![yellow button](https://community.metabrainz.org/uploads/default/original/3X/3/8/38e95218b61ee9628ebcf15b0fa89470eea2e90f.png)

1. Go to your collection’s first page ( **Overview** tab)
2. You can optionally order by what column you want
3. Click on the yellow **Load all pages for print** button
4. Wait for all pages to be loaded and appended // s(h)it back and relax
5. Launch your Print preview (usually now it’s **Ctrl** + **P** shortcut)
6. Try printing colours and backgrounds for better readability

 ![print preview](https://community.metabrainz.org/uploads/default/original/3X/c/f/cf0e03e067289b9063d7631e815ba3632954dd75.png)

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [March 9, 2021, 12:32am UTC](https://community.metabrainz.org/t/script-for-printing-collections/521437/20 "2021-03-09T00:32:01Z")

</div>

It’s even useful on mobile (Android Firefox 68.11.0 only) where the Page \> Save as PDF makes a very usable PDF out of it.  
Very convenient to inline search your whole collection, when in shops, without being able to print.

[Next page](https://community.metabrainz.org/t/script-for-printing-collections/521437.md?page=2)
