Small Node.js script to sort an Anki collection by word frequncy. Default frequency DB is for English, source. You can make and use your own frequency DB, just follow the format of the default one.
To convert your decks/collection to JSON, you can use this Anki addon.