473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

generating a tree-like structure

Hi,

This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

Any ideas appreciated...
Thorsten
May 31 '07 #1
3 2540
On May 31, 12:44 pm, Thorsten Kampe <thors...@thorstenkampe.dewrote:
Hi,

This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

Any ideas appreciated...

Thorsten
I think you might be able to use ElementTree. The website for the
module claims it can be used for hierarchical data structures:
http://effbot.org/zone/element-index.htm

Did you look at any of the Python LDAP tools? They might be useful
too. See some of the links below:
http://linuxjournal.com/article/6988
http://aspn.activestate.com/ASPN/Coo.../Recipe/303336

Hopefully they'll give some guidance. I've not used LDAP myself as of
yet.

Mike

May 31 '07 #2
* (31 May 2007 12:15:48 -0700)
On May 31, 12:44 pm, Thorsten Kampe <thors...@thorstenkampe.dewrote:
This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

I think you might be able to use ElementTree. The website for the
module claims it can be used for hierarchical data structures:
http://effbot.org/zone/element-index.htm

Did you look at any of the Python LDAP tools? They might be useful
too. See some of the links below:
http://linuxjournal.com/article/6988
http://aspn.activestate.com/ASPN/Coo.../Recipe/303336

Hopefully they'll give some guidance. I've not used LDAP myself as of
yet.
I already have the LDAP output part working - with python-ldap under
Cygwin - and I generate HMTL output with markup.py. Pretty simple. But
a tree structure output would be even prettier...
May 31 '07 #3
On 2007-05-31, Thorsten Kampe <th******@thorstenkampe.dewrote:
* (31 May 2007 12:15:48 -0700)
>On May 31, 12:44 pm, Thorsten Kampe <thors...@thorstenkampe.dewrote:
This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?

To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.

Now I was thinking: would it be possible to generate from the totally
unordered output that the LDAP server gives me, a tree like
representation that displays the hierarchy (omitting the values or
even properties if necessary)?

It should be a textual representation of what you see in GUI programs
like "LDAP Administrator" but the output should be represented like
the "tree" program in Linux or Windows "tree.com".

I think you might be able to use ElementTree. The website for the
module claims it can be used for hierarchical data structures:
http://effbot.org/zone/element-index.htm

Did you look at any of the Python LDAP tools? They might be useful
too. See some of the links below:
http://linuxjournal.com/article/6988
http://aspn.activestate.com/ASPN/Coo.../Recipe/303336

Hopefully they'll give some guidance. I've not used LDAP myself as of
yet.

I already have the LDAP output part working - with python-ldap under
Cygwin - and I generate HMTL output with markup.py. Pretty simple. But
a tree structure output would be even prettier...
I would probably generate a DOT file to get a 2D visualization. DOT is part of
Graphviz (graphviz.org), and there are quite a few graphviz front-ends
available in Python to make DOT generation easier (pydot, yapgvb, and probably
a few others).

Albert
Jun 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tree menu using XML | last post by:
I have one XML file that has nodes and sub node and each and every node has the attribute call visible if its value is true then diplay this node else don't display thid node, but this condition i...
4
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working,...
2
by: New | last post by:
Why does this code insert a node into a binary search tree correctly? If I only inserting going by first digit it works properly but when I try inserting going by the whole ip and the port number...
5
by: Mike | last post by:
Why does this code insert a node into a binary search tree correctly? If I only inserting going by first digit it works properly but when I try inserting going by the whole ip and the port number...
5
by: Liz | last post by:
C# .NET creating a tree programmatically treeView1.BeginUpdate(); treeView1.Nodes.Clear(); treeView1.Nodes.Add(new TreeNode("Client Details")); tvSelect.Nodes.Add(new TreeNode("Referrals"));...
2
by: Kiran | last post by:
Hello all, I am using a tree to display stuff, and it is constantly updated, but what I have noticed is in the lowest level, there is clearly noticable cutoff of the text I place there. The cutoff...
8
by: Craig | last post by:
Hi there, I'm only new to Python so please bear with me. I using ElementTree to generate an XML file that will reference a DTD and an XSL file. The header information I want at the start of...
2
by: Prasad | last post by:
This was our earlier design <Product Inventory Info> <Company> <Make>Computer General</Make> <Model>Wizbang 1900</Model> It was later found that <Product Inventory Infohad spaces in...
4
by: viperman5000 | last post by:
Using for loops, how would you generate a Christmas Tree using *'s. Also, the size depends on the user's input (size). Any help would be greatly appreciated, as my grade depends on it.
2
by: rednarjess | last post by:
Hello every body; When I want to generate the Javadoc for my project, The result is fine at the bigining of the generating init: Generating Javadoc Javadoc execution Loading source file...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.