Recent Changes - Search:

Ibid

PmWiki Help

edit SideBar

Factpacks

Blueprint: https://blueprints.launchpad.net/ibid/+spec/factpacks

Since a number of Knab features can be done with factoids (Divine, RoShamBo, etc.), we need a way to distribute a collection of facts which bot owners can import into their database. These factpacks must also be removable. We therefore need to determine a file format, and import/remove mechanism. We also need to consider what happens to entries modified/added by users when removing the factpack.

File Formats

Pure python

facts = [
(("name1", "name2"), ("value1", "value2"))
]
  • Easy to load
  • Possible security risk with third party factpacks

CSV with alternating rows of names and values

foo, bar
baz, quaz

Line based with headers

Names:
foo
bar
Values:
baz
quaz

Line based with prefixes

Name: foo
Name: bar
Value: baz
Value: quaz

JSON

[
[["name1", "name2"], ["value1", "value2"]],
]
  • Essentially same syntax as pure Python
  • Less of a security issue

XML

I think it's compulsory to mention it...

Remove

Hardcode high factoid_ids in factpack, remove based on those

  • Requires the original factpack when removing
  • Issue with the factpack being upgraded

Mark entries in Ibid's database

  • Column with name of factpack
  • Removable without the factpack
  • Can list the loaded factpacks

Try to match factpack names/values against database

  • Probably not very solid
Edit - History - Print - Recent Changes - Search
Page last modified on April 19, 2009, at 11:37 AM