Topic: Sort by artist with most posts

Posted under Tag/Wiki Projects and Questions

Is there a way to sort posts by artist with most posts within search (to artist with least posts within search)?
As far as I can tell there's only order:artist_tags, but I'm not looking for the amount of tags.
I'd also be okay with something like, artists by alphabet.
But say I searched ~dagasi ~zonkpunch ~blitzdrachin, in the case of alphabetical it would show all of blitzdrachin's posts first (then by ID if I had to assume), then dagasi's, then zonkpunch's, otherwise by how many posts they have with their tag.
If it's not a thing, that would be cool. Sorry if it's already been answered.

You should also see topics on CSV data wrangling, if you have space to store the database export. I recommend QSV(Quicksilver) to do the heavy lifting, as it has many features good for this.
Basically, in this case:
1) Extract the list of tags with category of artist (1) from the tags list. This gets you all the artists.
2) Extract only the tags and post ID from the posts list (the huge 4GB monster text file). This gets you just the tags to search/count through.
3) 'Explode' the output so that you get each tag on a separate line.
4) Then count the number of times each artist tag appears in that file.
If you use some tool generic to text files for counting the number of times a word in a list occurs, you can combine 2 through 4 in a single step.
This is probably a great use for Python. ;)

Quick and dirty script example (For Windows, Linux bash is similar):
The first line is step 1. The second line is steps 2-3 combined to speed it up a bit and not waste as much space. The forth line just filters out non-artist tags, and counts the remaining tags. Last line is obvious! ;)

qsv search -s category 1 tags-2025-08-06.csv | qsv select name | qsv sort -o artist-names.csv
qsv select id,tag_string posts-2025-08-06.csv | qsv explode tag_string " " | qsv select tag_string | qsv sort -o post-tags.csv
qsv exclude -v tag_string post-tags.csv name artist-names.csv | qsv frequency -l 0 | qsv select 2,3 > artist-frequency.csv
notepad artist-frequency.csv

The only gotcha with this is it includes ALL tags in the artist category, even ones that aren't specific artists. I'll post the results after making space on my laptop.

Updated

Original page: https://e621.net/forum_topics/58844