beets-top: find top artists, genres, years

43 views
Skip to first unread message

michael....@gmail.com

unread,
Apr 21, 2013, 2:19:29 PM4/21/13
to beets...@googlegroups.com
Here's my first attempt at a plugin for beets


In fact, it is the first thing I've written in Python at all, so I'm looking forward to suggestions on improving the code.

What does it do? You can write queries like this
$ beet top artists
$ beet top 100 artists
$ beet top artists by albums
$ beet top 42 artists by time in 1990,1995-2000
$ beet top genres by tracks
$ beet top years by albums
The general syntax is

$ beet top [<count>] {artists, albumartists, formats, genres, labels, years, composers} [by {albums, tracks, time}] [in <years>]

I have no idea how to properly install a plugin. On my own system, I have created a symlink from within beets' own beetsplug directory to my top.py, but that is surely not a brilliant idea.

Michael

Adrian Sampson

unread,
Apr 21, 2013, 3:29:55 PM4/21/13
to beets...@googlegroups.com
Very cool! I like this idea -- it's an interesting way of looking at your collection.

FWIW, one way of installing non-standard beets plugins is with the "pluginpath" config option:
but setuptools/pip installation can interfere with this.

A couple of thoughts about the interface to the plugin:

- For command-line interfaces, people typically like to distinguish argument values from "control signals" by making the latter look like --flags. For example, I might find:
$ beet top artists --by time --in 1990
a bit more grokkable since it makes it obvious which words are special.

- To make the "in" clause more general, have you considered allowing a beets query to appear there? For example, I might be interested in "top artists --in genre:indie" or something. We don't currently have range queries in the standard syntax, but this would be interesting to add.

Awesome work!

Adrian

 
--
You received this message because you are subscribed to the Google Groups "beets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beets-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

michael....@gmail.com

unread,
Apr 21, 2013, 5:00:51 PM4/21/13
to beets...@googlegroups.com


On Sunday, April 21, 2013 9:29:55 PM UTC+2, Adrian Sampson wrote:
Very cool! I like this idea -- it's an interesting way of looking at your collection.

FWIW, one way of installing non-standard beets plugins is with the "pluginpath" config option:
but setuptools/pip installation can interfere with this.

A couple of thoughts about the interface to the plugin:

- For command-line interfaces, people typically like to distinguish argument values from "control signals" by making the latter look like --flags. For example, I might find:
$ beet top artists --by time --in 1990
a bit more grokkable since it makes it obvious which words are special.

Yes, I considered this, but I was lazy and didn't look into how options are declared in beets' UI. Besides, I like the human-language like character of the interspersed keywords, but I agree that "dasherized" options are the conventional way of doing it.
 

- To make the "in" clause more general, have you considered allowing a beets query to appear there? For example, I might be interested in "top artists --in genre:indie" or something. We don't currently have range queries in the standard syntax, but this would be interesting to add.

 
I'll look into it next weekend. I think I can get away with nesting another subquery in place of the reference to the items table.

Michael
Reply all
Reply to author
Forward
0 new messages