cargo tally
is a Cargo subcommand for drawing graphs of the number of direct
dependencies on a crate over time. Scroll down for some graphs!
```
Usage: cargo tally --init
cargo tally [options]
Options: --graph TITLE Display line graph using gnuplot, rather than dump csv --relative Display as a fraction of total crates, not absolute number --exclude REGEX Ignore a dependency coming from any crates matching regex ```
cargo install cargo-tally
cargo tally --init
There is a one-time setup step that downloads and extracts a 15 MB tarball of
crates.io metadata into a directory called tally
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 open gnuplot
with a line graph.
Requires gnuplot
to be present in your $PATH. On Ubuntu I was able to
install this with sudo apt install gnuplot
. 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 major+minor version like
serde:0.9
. If a major+minor 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.
cargo tally --graph "Serde vs rustc-serialize direct dependencies" rustc-serialize serde
cargo tally --exclude '^google-' --graph "Number of direct dependencies by Serde version" serde:0.5 serde:0.6 serde:0.7 serde:0.8 serde:0.9 serde:1.0
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.