💾 Archived View for ploum.net › liblarch-a-python-library-for-trees › index.gmi captured on 2024-08-18 at 19:10:45. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-10)

-=-=-=-=-=-=-

Liblarch, a python library to handle trees and acyclic graphs

2012-11-08

Lesson number one

Some of you may be aware that Getting Things GNOME! 0.3 was released. What you may not know is that GTG is now using a python library called liblarch and that liblarch 2.1.0 was released today.

Getting Things GNOME! 0.3

liblarch 2.1.0 was released today

Liblarch is a python library specifically designed to handle complex trees (including directed acyclic graphs) and to display them. A liblarch-gtk component allows you to display different views of your tree in a GTK TreeView widget without any effort.

During the development of GTG, we faced major problems to handle our tree of tasks and our tree of tags. The features we wanted proved to be very complex to implement and very fragile : solving a bug would create two others. And the performance work was a nightmare.

We decided to abstract the whole concept of tree and to make it a standalone, well tested and optimized library. We are very proud of it and we are looking for more applications that would benefit from using liblarch.

liblarch

Liblarch is designed to be as simple as possible from the programmer point of view. The nodes of your tree can be any python object. You only need to inherit from liblarch TreeNode. Once you have a node, you will connect it to a tree. It can be a node without parent, with a single parent or even with multiple parents.

Where liblarch becomes powerful is to display a given tree : you can have multiple views over the same tree, add a complex filter or even a combination of multiple filters. And all of that can be quite easily displayed in a GTK TreeView. Easy and GTK TreeView in the same sentence? Sounds impossible? Not with liblarch!

How liblarch is working

As an example, you can test our implemenation of a dummy contact list. By reading the code, you will see how straightfoward it is to have searching capabilities in the contact list, contacts in multiple groups, hiding offline contacts or updating automatically when a new contact comes online.

a dummy contact list

Liblarch comes with an extensive test suite. The next challenge is to port it to Python3/GTK3 and to write a good built-in documentation. Any help is welcome 🙂 (EDIT: we are also looking for packagers)

----

Email:

gemini24@ploum.eu

permalinks:

gemini://ploum.net/liblarch-a-python-library-for-trees/index.gmi

https://ploum.net/liblarch-a-python-library-for-trees/index.html