pyrantA Python wrapper around Tyrant implementation | |
Download |
pyrant Ranking & Summary
Advertisement
- License:
- The Apache License 2.0
- Price:
- FREE
- Publisher Name:
- Martin Conte Mac Donell
- Publisher web site:
- http://code.google.com/u/Reflejo/
pyrant Tags
pyrant Description
A Python wrapper around Tyrant implementation pyrant is a pythonic python-only implementation of Tokyo Tyrant protocol. Table extension and query operations are also implementend. "Python 2.4+ is needed."This library takes a "pythonic" approach to make it more clear and easy to implement.Hash DatabaseUsing hash database is like using dictionaries on python with some extra features. (You can see the docstrings to learn all the features) >>> import pyrant >>> t = pyrant.Tyrant(host='127.0.0.1', port=1978) >>> t = 'foo' >>> print t foo >>> t.concat('key', 'bar') >>> print t foobar >>> 'key' in t True >>> del t >>> print t Traceback (most recent call last): ... KeyError: 'key'Table Databasepyrant supports table records and query operations. To insert a record just use as before but set a dictionary as value.Table record example >>> from pyrant import Tyrant, Q >>> t = Tyrant(host='127.0.0.1', port=1978) >>> t = {'name': 'Martin Conte Mac Donell', 'gender': 'M', 'age': 26} >>> t = {'name': 'Guido', 'gender': 'M', 'age': 33} >>> print t {'name': 'Martin Conte Mac Donell', 'gender': 'M'} Requirements: · Python
pyrant Related Software