Cargo tally
cargo tally
is a Cargo subcommand for drawing graphs of the number of crates
that depend directly or indirectly on a crate over time.
Usage: cargo tally --init
cargo tally [options] <crate>...
Options:
--graph TITLE Display line graph using gnuplot, rather than dump csv
--relative Display as a fraction of total crates, not absolute number
--transitive Count transitive dependencies, not just direct dependencies
--exclude REGEX Ignore a dependency coming from any crates matching regex
Installation
cargo install cargo-tally
cargo tally --init
-
There is a one-time setup step that downloads a 7 MB json file of crates.io metadata into a file called
tally.json.gz
within the current directory. Subsequent queries read from this cached data and do not query crates.io. -
By default
cargo tally
prints out a CSV with a timestamp column and one column for each crate being tallied. Pass the--graph
flag with a title, like--graph "Exponential growth!"
, to pop opengnuplot
with a line graph. Requiresgnuplot
to be present in your $PATH. On Ubuntu I was able to install this withsudo apt install gnuplot
. On macOS you wantbrew install gnuplot --with-qt
. If you can't get that working, you can always run without--graph
and make your own graphs in Excel or Gnumeric. -
The tally command accepts a list of which crates to tally. This can either be the name of a crate like
serde
or a name with arbitrary semver version specification likeserde:0.9
. If a version is not specified, dependencies on all versions of the crate are tallied together. -
If you come up with an interesting graph, please open an issue and just drop the picture in there! I would love to see what you find! Also @mention the crates' authors if you would like to share with them.