| Crates.io | unidep |
| lib.rs | unidep |
| version | 0.1.0 |
| created_at | 2025-05-24 22:08:32.435436+00 |
| updated_at | 2025-05-24 22:08:32.435436+00 |
| description | A universal dependency graph generator at either files or functions level. |
| homepage | https://remigerme.github.io/unidep/ |
| repository | https://github.com/remigerme/unidep |
| max_upload_size | |
| id | 1687790 |
| size | 2,722,212 |
Unidep might (hopefully) support a large number of programming languages. The default installation installs everything, but it is also possible to specify the languages you are interested in to keep dependencies manageable.
The default installation will install all currently supported languages. You can use unidep:
cargo install unidep
Cargo.toml:
[dependencies]
unidep = "0.1.0"
To install only a selected subset of languages (see the list of currently supported languages):
cargo install unidep --no-default-features --features "python,rust"
Or, if you plan to use unidep as a library:
[dependencies]
unidep = { version = "0.1.0", default-features = false, features = ["python", "rust"]}
For now, there are obviously no language supported at all.
pythonrustIf your favorite language is missing, feel free to contribute.
There are two kinds of dependencies:
Dependencies between functions are straightforward, all functions calls are intercepted by the iterator, and are added as dependencies of the current functions. Note that different functions of this function tree may live in different source files - and we want to keep track of that (the same function might live in multiple files! because it can be declared multiple times and defined once).
Dependencies between files are slightly more complicated. They can be explicit, with some import or include directives. But they can also be implicit: let's say we have a file a.h declaring various functions, themselves defined in both a.c and b.c. a.h is an explicit dependency of both a.c and b.c. But a.h also implicitly depends on a.c and b.c - because the function definitions live there.
Unidep supports:
Unidep doesn't support:
Obviously, unidep relies heavily on the whole tree-sitter project.
Plenty of language-specific tools already exist. Below is a small sample from some popular ones.
| Language | Tool |
|---|---|
| C/C++ | include-what-you-use |
| C/C++ | cpp-dependencies |
| C/C++ | clang-include-graph |
| Java | Jarviz |
| JavaScript | Madge |
| JavaScript | dependency-cruiser |
| OCaml | odep |
| Python | pydeps |
| Rust | cargo-depgraph |
| Python, JavaScript, PHP, Ruby | code2flow |
| Python, Rust | StackWalk |
TODO
Thanks to all (future?) contributors!