# \[ANN\] odep initial release

**URL:** <https://discuss.ocaml.org/t/ann-odep-initial-release/11236>\
**Category:** Community\
**Tags:** opam, dune, announce\
**Created:** [January 24, 2023, 7:54am UTC](https://discuss.ocaml.org/t/ann-odep-initial-release/11236 "2023-01-24T07:54:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sim642](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/sim642/32/3597_2.png) [@sim642](https://discuss.ocaml.org/u/sim642)\
**Post date:** [January 24, 2023, 7:54am UTC](https://discuss.ocaml.org/t/ann-odep-initial-release/11236/1 "2023-01-24T07:54:51Z")

</div>

I’m glad to announce the initial release of [odep](https://github.com/sim642/odep) – dependency graphs generator for OCaml modules, libraries and packages.

Some months ago I was frustrated with the lack of such modern tool ([list of similar ones I found](https://github.com/sim642/odep#other-tools)) and decided to code up [one universal tool that covers all the use cases (xkcd reference)](https://xkcd.com/927/). After interest from the community, I have now made a proper release of the tool on opam.

## Example

Running `odep dune | dot -Tsvg` in the project’s own repository produces the following comprehensive graph. It shows modules in the project itself, clustered by dune libraries, and other findlib libraries, clustered by opam packages. This information is gathered and combined from `dune describe workspace --with-deps`, findlib and opam.  
[![](https://raw.githubusercontent.com/sim642/odep/master/img/dune-odep.svg)](https://raw.githubusercontent.com/sim642/odep/master/img/dune-odep.svg)  
See [README on GitHub](https://github.com/sim642/odep#examples) for more usage examples.

---

<div class="post-metadata">

**Author:** ![mobileink](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/mobileink/32/3295_2.png) [@mobileink](https://discuss.ocaml.org/u/mobileink)\
**Post date:** [February 11, 2023, 3:16pm UTC](https://discuss.ocaml.org/t/ann-odep-initial-release/11236/2 "2023-02-11T15:16:35Z")

</div>

Looks great! But is it tool-friendly? I could really use something like this to help convert dune files to Bazel files, but for that it would need to produce something that I can (easily) parse, like sexps. Can it do that? It would also be great if it were available as a library.

---

<div class="post-metadata">

**Author:** ![sim642](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/sim642/32/3597_2.png) [@sim642](https://discuss.ocaml.org/u/sim642)\
**Post date:** [February 11, 2023, 5:47pm UTC](https://discuss.ocaml.org/t/ann-odep-initial-release/11236/3 "2023-02-11T17:47:56Z")

</div>

It simply uses `dune describe workspace --with-deps` to get information from a dune project. That already is sexp output, so you might as well parse it directly (like odep does) and use it however you need, as opposed to having odep provide a library-like abstraction layer on top of that.

---

<div class="post-metadata">

**Author:** ![gasche](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/gasche/32/4_2.png) [@gasche](https://discuss.ocaml.org/u/gasche)\
**Post date:** [February 12, 2023, 8:19am UTC](https://discuss.ocaml.org/t/ann-odep-initial-release/11236/4 "2023-02-12T08:19:26Z")

</div>

Thanks! I hacked something quick when I had the same need (as a [hacky branch](https://github.com/gasche/dune-deps/tree/modules) on top of @mjambon’s dune-deps), but the output of your tool is much nicer, I will use it next time. Also, dune-deps [appears to be unmaintained](https://github.com/mjambon/dune-deps/pull/25) so it is good to have a replacement.

(Random implementation note: when I had to hack something from the Dune output I had a need for a combinator library to process s-expressions, discussed in [Combinator library for extracting data for s-exps?](https://discuss.ocaml.org/t/combinator-library-for-extracting-data-for-s-exps/10153/1) . I see that your projects uses the `@@deriving` route ( [odep/dune\_describe.ml at master · sim642/odep · GitHub](https://github.com/sim642/odep/blob/master/src/dune_describe/dune_describe.ml) ), which I guess is a fine solution in this specific case – as proposed in [Combinator library for extracting data for s-exps? - #25 by Gopiandcode](https://discuss.ocaml.org/t/combinator-library-for-extracting-data-for-s-exps/10153/25) . My own take-away from the discussion was that [ocaml-decoders](https://github.com/mattjbray/ocaml-decoders/) and its `Decoders_sexplib` package also work well for this need – [Combinator library for extracting data for s-exps? - #37 by gasche](https://discuss.ocaml.org/t/combinator-library-for-extracting-data-for-s-exps/10153/37) .)
