Skip to content
Stats tools for MELPA
Emacs Lisp
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.org
melpa-stats.el

README.org

MELPA Stats

This little package provides some easy ways to get stats about MELPA packages.

Installation

I recommend using quelpa-use-package, like this:

(use-package melpa-stats
  :quelpa (melpa-stats :fetcher github :repo "alphapapa/melpa-stats"))

Usage

Examples

Show current package version and download counts for packages by a certain author. This could be useful for recording package download counts over time.

(->> (melpa/select-packages :authors "Jonas Bernoulli"
                            :maintainers "Jonas Bernoulli"
                            :urls "tarsius")
     (--map (cons (car it)
                  (list (cons 'version (melpa/package-field '(ver) it))
                        (cons 'downloads (alist-get (car it) (melpa/downloads))))))
     (--sort (alist-get 'downloads (cdr it)))
     (-take 3))
;; =>
;; ((git-commit (version . [20190717 29])
;;              (downloads . 500506))
;;  (gitattributes-mode (version . [20180318 1956])
;;                      (downloads . 166632))
;;  (gitconfig-mode (version . [20180318 1956])
;;                  (downloads . 274473)))

Show packages depending on packages by a certain author:

(->> (melpa-stats/select-packages :maintainers "Jonas Bernoulli" :authors "Jonas Bernoulli")
     (--map (symbol-name (car it)))
     (--map (melpa-stats/select-packages :depends-on it))
     (-flatten-n 1)
     (--map (symbol-name (car it)))
     -uniq
     (-sort #'string<))
;;=> ("auto-compile" "backline" "borg" "build-farm" "djangonaut" "docker" ...)

Commands

melpa-stats/author-maintainer-package-counts
Return list of people by number of packages authored or maintained.
melpa-stats/author-package-counts
Return list of authors by package count. Interactively, display with pp-display-expression.
melpa-stats/maintainer-package-counts
Return list of maintainers by package count. Interactively, display with pp-display-expression.

Functions

melpa-stats/count
(FN LIST) Return alist of elements of LIST with counts, sorted with >. LIST is, first, grouped with seq-group-by by applying FN to each element.
melpa-stats/downloads
(&optional REFRESH) Return MELPA package data, read from download_counts.json
melpa-stats/package-field
(FIELD PACKAGE) Return value of FIELD in PACKAGE data. PACKAGE should be a package’s data structure as returned by melpa-stats/packages. FIELD should be a list of nested map keys as expected by a-get-in which correspond to the structure of the JSON data.
melpa-stats/package-version-and-downloads
(PACKAGE) Return version and download count for PACKAGE. PACKAGE should be a package data list as returned by melpa-stats/packages. Returns an alist like:

((version . [20170909 631]) (downloads . 431))

melpa-stats/packages
(&optional REFRESH) Return MELPA package data, read from archive.json.
melpa-stats/packages-by-author
Return alist of packages by author.
melpa-stats/packages-by-maintainer
Return alist of packages by maintainer.
melpa-stats/retrieve-json
(URL) Return parsed JSON object from URL.
melpa-stats/select-packages
(&key AUTHORS MAINTAINERS URLS DEPENDS-ON (TEST-FN #'string-match)) Return packages matching AUTHORS, MAINTAINERS, URLS, or DEPENDS-ON. Each argument may be one or a list of strings, which is tested against the corresponding field in each package in the MELPA archive. If any field matches any argument (boolean OR), the package is returned. Each of DEPENDS-ON is compared as a string against the names of packages’ dependencies.

License

GPLv3

You can’t perform that action at this time.