Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dtolnay/cargo-tally
Graph the number of crates that depend on your crate over time
https://github.com/dtolnay/cargo-tally
Last synced: 3 days ago
JSON representation
Graph the number of crates that depend on your crate over time
- Host: GitHub
- URL: https://github.com/dtolnay/cargo-tally
- Owner: dtolnay
- License: apache-2.0
- Created: 2017-11-21T05:48:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-03T04:57:57.000Z (18 days ago)
- Last Synced: 2025-01-10T23:06:19.137Z (10 days ago)
- Language: Rust
- Homepage:
- Size: 1.06 MB
- Stars: 236
- Watchers: 3
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# 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 [options] queries...Options:
--db Path to crates.io's database dump [default: ./db-dump.tar.gz]
--jobs, -j 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
```[](https://github.com/dtolnay/cargo-tally)
[](https://crates.io/crates/cargo-tally)
[](https://github.com/dtolnay/cargo-tally/actions?query=branch%3Amaster)
## Installation
```console
$ 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](https://d3js.org/); 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][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][regex-relative]
---
- 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][failure-anyhow-thiserror]
---
- Fraction of crates.io that depends transitively on libc.
**`$ cargo tally --relative --transitive libc`**
![Fraction of crates.io that depends transitively on libc][libc]
[regex]: https://user-images.githubusercontent.com/1940490/122184090-bc75d600-ce40-11eb-856b-affc568d2e15.png
[regex-relative]: https://user-images.githubusercontent.com/1940490/122184174-d31c2d00-ce40-11eb-8c17-bde6f3015c28.png
[failure-anyhow-thiserror]: https://user-images.githubusercontent.com/1940490/122184103-bf70c680-ce40-11eb-890c-988cd96f4428.png
[libc]: https://user-images.githubusercontent.com/1940490/122184112-c13a8a00-ce40-11eb-8bdb-a7f6f03d2d91.png---
## Credits
The implementation is powered by [differential-dataflow].
[differential-dataflow]: https://github.com/TimelyDataflow/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.