我正在寻找东京内阁桌面引擎的python绑定。我试过Pytc但只能找到Hash和B-tree引擎支持。还有其他绑定吗?
答案 0 :(得分:7)
以下是使用PyTyrant搜索表引擎的实现:
答案 1 :(得分:4)
我与tc的作者有联系,他告诉我以下内容:
目前,表(tdb)驱动程序 存在于master branch(unit tests)和fdb driver中 正在另一个分支机构中开发。
我尝试使用表驱动程序进行小测试,并计划很快在较大的表上进行尝试。
答案 2 :(得分:2)
我已经监控(有时候会改进)TC的各种Python绑定超过一年,所以这里是一个符合您标准的最佳绑定的更新列表。
有许多陈旧和/或不完整的替代品。
答案 3 :(得分:2)
我的pytc分支名为“tc”确实支持表格(TDB)http://github.com/rsms/tc
基本示例:
>>> import tc
>>> db = tc.TDB("slab.tdb", tc.TDBOWRITER | tc.TDBOCREAT)
>>> db.put('some key', {'name': 'John Doe', 'age': '45', 'city': u'Internets'})
>>> rec = db.get('some key')
>>> print rec['name']
John Doe
执行查询:
>>> import tc
>>> db = tc.TDB("slab.tdb", tc.TDBOWRITER | tc.TDBOCREAT)
>>> db.put('torgny', {'name': 'Torgny Korv', 'age': '31', 'colors': 'red,blue,green'})
>>> db.put('rosa', {'name': 'Rosa Flying', 'age': '29', 'colors': 'pink,blue,green'})
>>> db.put('jdoe', {'name': 'John Doe', 'age': '45', 'colors': 'red,green,orange'})
>>> q = db.query()
>>> q.keys()
['torgny', 'rosa', 'jdoe']
>>> q.filter('age', tc.TDBQCNUMGE, '30')
>>> q.keys()
['torgny', 'jdoe']
>>> q.filter('colors', tc.TDBQCSTROR, 'blue')
>>> q.keys()
['torgny']
>>> # new query:
>>> q = db.query()
>>> q.order('name') # Ascending order by default
>>> q.keys()
['jdoe', 'rosa', 'torgny']
>>> q.order(type=tc.TDBQONUMASC, column='age')
>>> q.keys()
['jdoe', 'torgny', 'rosa']
TDB单元测试中的更多示例:http://github.com/rsms/tc/blob/master/lib/tc/test/tdb.py
答案 4 :(得分:1)