#cargo-subcommand #cargo #graph #io #numbers #version #depend

bin+lib cargo-tally

Cargo subcommand for drawing graphs of the number of dependencies on a crate over time

87 releases (56 stable)

new 1.0.56 Dec 5, 2024
1.0.54 Nov 30, 2024
1.0.48 Jul 5, 2024
1.0.42 Mar 24, 2024
0.2.0 Nov 27, 2017

#282 in Cargo plugins

Download history 29/week @ 2024-08-18 30/week @ 2024-08-25 38/week @ 2024-09-01 37/week @ 2024-09-08 33/week @ 2024-09-15 102/week @ 2024-09-22 39/week @ 2024-09-29 245/week @ 2024-10-06 82/week @ 2024-10-13 36/week @ 2024-10-20 174/week @ 2024-10-27 220/week @ 2024-11-03 113/week @ 2024-11-10 288/week @ 2024-11-17 185/week @ 2024-11-24 339/week @ 2024-12-01

932 downloads per month

MIT/Apache

135KB
3.5K SLoC

Cargo tally

Number of crates that depend directly on each regex version Fraction of crates that depend on failure vs anyhow and thiserror Fraction of crates.io that depends transitively on libc

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 [options] queries...

Options:
    --db <PATH>       Path to crates.io's database dump [default: ./db-dump.tar.gz]
    --jobs, -j <N>    Number of threads to run differential dataflow
    --relative        Display as a fraction of total crates, not absolute number
    --transitive      Count transitive dependencies, not just direct dependencies

github crates.io build status


Installation

$ wget https://static.crates.io/db-dump.tar.gz
$ cargo install cargo-tally
  • Data is drawn from crates.io database dumps, which are published nightly by automation running on crates.io. You can download a new dump whenever you feel like having fresh data.

  • 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 like serde:1.0. If a version is not specified, dependencies on all versions of the crate are tallied together.

  • The generated graphs use D3; the cargo tally command should pop open a browser showing your graph. It uses the same mechanism that cargo doc --open uses so hopefully it works well on various systems.



Examples

  • Number of crates that depend directly on each major version of the regex crate.

    $ cargo tally regex:0.1 regex:0.2 regex:1.0

Number of crates that depend directly on each major version of regex



  • Fraction of crates.io that depends directly on each major version of the regex crate. This is the same graph as the previous, but scaled to the exponentially growing total number of crates on crates.io.

    $ cargo tally regex:0.1 regex:0.2 regex:1.0 --relative

Fraction of crates.io that depends directly on each major version of regex



  • Fraction of crates.io that depends directly on various error handling libraries. Note that crates are not double-counted; a crate that depends on both anyhow and thiserror counts as only one for the purpose of the anyhow+thiserror curve.

    $ cargo tally --relative failure anyhow thiserror anyhow+thiserror

Fraction of crates.io that depends directly on various error handling libraries



  • Fraction of crates.io that depends transitively on libc.

    $ cargo tally --relative --transitive libc

Fraction of crates.io that depends transitively on libc



Credits

The implementation is powered by differential-dataflow.


License

Licensed under either of Apache License, Version 2.0 or MIT license 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.

Dependencies

~18–48MB
~702K SLoC