top-crates lists the top crates in the Rust ecosystem and their dependencies.
It can build an index that can be configured in Cargo or mirrored by Romt or Panamax.
Both are designed to mirror the entire Rust ecosystem (70-80Gb by early 2022), which can be a drawback.
top-crates can also make a local registry (like cargo local-registry) that can be used with Cargo.
This local registry can be added to a Docker image to create an isolated development environment for Rust.
pip3 install tomli python-dateutil
git clone --recursive https://github.com/rene-d/top-crates
Note the --recursive
flag: indeed the full crates index is required to resolve dependencies. It takes about 1.5Gb for this index and 0.3Gb for the crates.
Get full usage information with --help
or -h
.
The configuration file top-crates.toml
has six self-explanatory sections:
top-crates
: the most downloaded cratescookbook
: to add crates from the Rust Cookbookcategories
: most downloaded crates by categoryexclusions
: to exclude useless or unwanted cratesadditions
: manually added cratescommands
: manually added command line tools
Update the crates.io index and prepare the local registry:
./top-crates.py -u -p
Create or add to the file $CARGO_HOME/config
(~/.cargo/config
by default) the following lines:
[source.local]
local-registry = "/path/to/local-registry"
[source.crates-io]
replace-with = "local"