ldif2dot

This is a simple Python script to convert LDIF files (produced by e.g. ldapsearch) to DOT files (read by the graph drawing program dot). This lets you make picture representations of LDAP Directory Information Trees.

The program was written as part of the mod_shared_roster_ldap project for ejabberd. I needed to produce pictures of small example LDAP trees for the project documentation, but I could not find a program which would do that. Therefore I wrote this simple script, which only has a feature set needed for this task. The program does not support special value encodings, line continuations, etc. The whole LDIF file is loaded into memory, so processing very large files is not recommended.

Below is an example picture of a tree, obtained by running the following command:

ldapsearch -x -b 'dc=nodomain' | \
      ldif2dot | \
      dot -o nodomain.png -Nshape=box -Tpng /dev/stdin

Here you can download the program:

Last modification of this page: 2022-03-16 16:25:17 UTC