Import tags from csv

Hi,

i was wondering if there is a feature with which i can import tags (for existing items) from a flat file. I collect music which is not always available on discogs/musicbrainz. Plus sometimes the importer doesnt copy the right track info when importing so an easy workflow to correct these things “by hand” would help me out immensely.

Thanks in advance for your help,
Johan

Interesting idea! I personally can’t think of anything in beets that would let you do that exactly. The closest thing might be the edit plugin, which lets you modify the metadata for your music as a YAML document. You might also be interested in trying to craft your own plugin for this use case, if that’s feasible.

thanks for your quick reply. i am currently reading through the source code, to understand how it works. i would love to build a plugin for this, but i still need to learn a couple of things before i’d be able to do so.

this might be a bit of a noob question, but do you have any advice which tool/method I can use to debug (more specifically step through the code) with specific commands?

in other words, I want to see what functions get triggered in what order if I type in a command like “beet edit artist=Perko”.

the edit command doesnt work for me atm, and more generally i would like to learn how i can look at the inner workings of beets in action.

I think my best suggestion would be to use pdb:

It’s not exactly easy to use, but it’s super powerful and therefore probably worth learning if you’re interested in exploring. You can insert a set_trace call inside the edit plugin and see the stacktrace there, step through the code one line at a time, etc.

Thank you very much! I have started to look into it. might take me a bit to fully understand it.

This would be a cool feature! I have started to use beets for cataloging audio files and it would help a lot if I could create some preset file (CSV or else) which says:

Files matching this regex/string pattern in the file name should get these fields.

And then on import applies this automatically.

I found out the other day that mp3tag now has a beta mac version. So I’m using this now for my needs until I more fully understand the beets code.

I did this with a bash script. It reads lines from beet_batch.txt and evals them with “beet mod -y”. I echo’d it to another file so I could see what it did and fix those cases where the artist+title matched more than one song.