用于中小型分层数据结构的 GUI 工具和 API

发布于 2024-09-06 19:11:21 字数 1756 浏览 6 评论 0原文

我正在尝试找到一个工具和库来编辑、写入和读取分层结构中的数据,类似于 LDAP 树、Windows 注册表或 Berkeley DB 结构。 键应该代表某种层次结构,值应该具有相对灵活的格式(键入是可选的,但可能很有用)。下面是一个示例:

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

用例是:

  1. 通过方便的 GUI 编辑数据存储。 这可能类似于 Windows Regedit 或 Apache Directory Studio(LDAP 浏览器)

  2. 将该数据保存到某个存储(例如文件)中。

  3. 从另一个能够查询的应用程序加载此商店 它来自 API。理想情况下,该库可以从 Python 调用。

我希望这些操作的读取速度相当快,但不要提前将其全部加载到内存中。数据存储将或多或少地手动更新到应用程序中,比读取数据的频率要低得多。 能够从 API 写入该数据将是一个优势,但这不是一个严格的要求。

查询会很好。例如(在伪查询中),“List Items/* where top == 10”将返回:

  • Items/item_1
  • Items/item_2

易于编辑(通过良好的 GUI)是最重要的功能之一。

我考虑了几个选项:

  1. LDAP 服务器可以满足大多数要求(特别是在 Apache Directory Studio 的帮助下)。然而,仅仅为此部署 LDAP 服务器就太繁重了。无论 Apache Directory Studio 有多好,用户仍然需要对 LDAP 有一定的了解(不仅仅是解释树层次结构)。我还希望在创建模式时具有一定的灵活性(或者根本没有模式) 而不必依赖管理员来完成此操作。

  2. Windows Regedit。我不确定这是否可能,但我想可以想象有一个类似注册表的文件,与实际的 Windows 注册表无关,可以通过 Regedit 编辑自定义内容。不过,我希望这个 GUI 应用程序能够在非 Windows 平台上使用,而且我什至不确定是否有一个 Python API 可以读取 Windows 注册表文件。

  3. RDF。那可行。我确信有相当好的用于语义网络的 Python 库。然而,我不需要任何推理能力。我宁愿有一些快速且不占用太多内存的东西。我不确定是否有任何好的 GUI 工具来查看和编辑树(因为它面向网络和图形)。

当然有一些方法可以在现有系统(例如 SQLite)之上构建这种数据结构,这很好,但我不确定是否有一个好的 GUI 可以与之一起使用。

我很乐意提出意见和建议,谢谢。

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:

  1. Edit the data store via a convenient GUI.
    This could look like Windows Regedit or Apache Directory Studio (LDAP Browser).

  2. Save that data into some store (e.g. a file).

  3. 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:

  1. 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.

  2. 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.

  3. 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨落星ぅ辰 2024-09-13 19:11:21

请原谅我的密度,但如果您的层次结构不是最粗略的示例,那么您必须有非常令人信服的、压倒性的理由来选择它,而不是 JSON 甚至(噗!)XML:

<items>
  <item>
   <number>1</number>
   <shape>rectangle</shape>
   <top>10</top>
   <left>10</left>
   <width>30</width>
   <height>40</height>
  </item>
  <item>
   <number>2</number>
   <shape>triangle</shape>
   <top>20</top>
   <left>50</left>
   <width>30></width>
   <height>40</height>
  </item>
</items>

对于 XML,您知道有很多满足您需求的编辑器。与 JSON 相同。而且我认为还有XML-> MySQL-> XML 库。

为什么不采取这种方法呢?

Forgive my densitosity, but if your hierarchy is anything but the roughest kind of example, there must be hugely compelling, overpowering reasons for your choosing that over, say, JSON or even (gulp!) XML:

<items>
  <item>
   <number>1</number>
   <shape>rectangle</shape>
   <top>10</top>
   <left>10</left>
   <width>30</width>
   <height>40</height>
  </item>
  <item>
   <number>2</number>
   <shape>triangle</shape>
   <top>20</top>
   <left>50</left>
   <width>30></width>
   <height>40</height>
  </item>
</items>

For XML, you know there are tons of editors that answer your needs. Same with JSON. And I think there are also XML-> MySQL -> XML libraries.

Why not take that kind of approach?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文