Hi,
I'm trying to find a tool and library to edit, write and read data in a hierarchical structure, similar to an LDAP tree, a Windows registry or a Berkeley DB structure. The keys should represent some hierarchy, and the values should have a relatively flexible format (typing is optional, but could be useful). Here is an example:
Items/item_1/shape = "rectangle"
Items/item_1/top = 10
Items/item_1/left = 10
Items/item_1/width = 30
Items/item_1/height = 40
Items/item_2/shape = "square"
Items/item_2/top = 10
Items/item_2/left = 10
Items/item_2/width = 30
Items/item_3/shape = "circle"
Items/item_3/centre_x = 40
Items/item_3/centre_y = 50
Items/item_3/radius = 20
Items/item_3/colour = blue
The use-case would be:
Edit the data store via a convenient GUI. This could look like Windows Regedit or Apache Directory Studio (LDAP Browser).
Save that data into some store (e.g. a file).
Load this store from another application, which would be able to query it from an API. The library for this would ideally be callable from Python.
I'd like these operations to be reasonably fast for reading, but not have it all loaded in memory in advance. The data store would be updated into the application more or less manually, much less often than the data is read. Being able to write to that data from the API would be a plus, but it's not a strict requirement.
Queries would be good. For example (in pseudo query), "List Items/* where top == 10" would return:
- Items/item_1
- Items/item_2
Ease of edition (via a good GUI) is one of the most important features.
I've considered a few options:
An LDAP server answers most requirements (especially with the help of Apache Directory Studio). However, deploying an LDAP server just for that is too heavy. However good Apache Directory Studio is, the user still needs a reasonable understanding of LDAP (more than just explaining the tree hierachy). I'd also like some flexibility in the creation of schemas (or no schemas at all) rather than having to rely on an administrator to do this.
Windows Regedit. I'm not sure if it's possible, but I guess it's conceivable to have a registry-like file that has nothing to do with the actual windows registry, editable with custom content via Regedit. I would however like this GUI application to be available on non-Windows platforms and I'm not even sure there's a Python API to read a Windows registry file.
RDF. That could work. I'm sure there are fairly good Python libraries for semantic web. However, I don't need any reasoning capabilities. I'd rather have something fast and that doesn't use much memory. I'm not sure there are any good GUI tools to view and edit the tree (since it's geared towards webs and graphs).
There are certainly ways to build this sort of data structures on top of existing systems like SQLite (for example), and this would be fine but I'm not sure whether there's a good GUI that would come with it.
I'd appreciate comments and suggestions, thank you.