Skip to main content

Crate contributor_graphs

Crate contributor_graphs 

Source
Expand description

Build contributor timelines from a git or GitHub repository.

contributor-graphs is primarily a command-line tool, but the same engine is available as a library. The usual flow is analyze to turn a repository into Contributor rows plus RepoMeta, then one of the renderers in svg or html.

use contributor_graphs::{analyze, svg, Config};

let analysis = analyze("nf-core/rnaseq", &Config::default())?;
let rows: Vec<_> = analysis.contributors.iter().filter(|c| !c.bot).cloned().collect();
let opts = svg::SvgOptions {
    title: analysis.meta.name.clone(),
    ..Default::default()
};
std::fs::write("rnaseq.svg", svg::render_svg(&rows, &opts))?;

The lower-level modules (repo, identity, github) are public too, for callers who want to assemble a custom pipeline.

Re-exports§

pub use model::Contributor;
pub use model::RepoMeta;

Modules§

cache
On-disk cache that makes re-runs fast. Everything lives under one tool-specific directory in the XDG cache location ($XDG_CACHE_HOME/contributor-graphs, else ~/.cache/contributor-graphs):
github
html
identity
model
progress
Progress bars for the slow, countable phases — cloning many repositories and the parallel GitHub enrichment passes — built on indicatif. The styling mirrors Seqera’s RustQC (cyan braille spinner, a filled bar, and a dim elapsed time) so the two tools feel consistent.
repo
svg
theme
Visual themes for both renderers.

Structs§

Analysis
The result of analyze: every contributor (bots included — filter on Contributor::bot if you don’t want them) and repository metadata.
Config
How to read history and resolve identities. Construct with Config::default() and override fields as needed.

Enums§

Sort
Row ordering for sort.

Functions§

analyze
Resolve a single repository (local path, owner/repo slug, or git URL) into contributor data and metadata. Shorthand for analyze_many with one source.
analyze_many
Resolve one or more repositories into a single combined timeline. Commits from every source are pooled, author identities are clustered across the whole pool, and commits that appear in more than one source (overlapping histories) are de-duplicated by commit SHA. Disjoint sources contribute distinct SHAs and so are simply concatenated.
sort
Sort contributor rows in place.