Depending on your platform, you may need gcc or another c compiler install in order to compile gevent. On Ubuntu installing python-dev is sufficient.
To install, simply:
pip install git+git://github.com/squirly/eece411-kvclient.git
To use the basic Key Value client:
from kvclient import KeyValueClient, InvalidKeyError
SERVER = 'squirly.ca:9090'
KEY = 'my_key'
VALUE = 'the value to be saved'
client = KeyValueClient(SERVER)
client.put(KEY, VALUE)
print(client.get(KEY))
client.delete(KEY)
try:
client.get(KEY)
except InvalidKeyError, error:
print(str(error))
To run tests:
from testing.test_types import get_test_from_string
from pprint import pprint
SERVER = 'squirly.ca:9090'
TEST_NAME = 'simple_compliance'
test = get_test_from_string(TEST_NAME, [SERVER])
results = test.run()
for result in results:
pprint(result.to_dict())
Getting the code:
git clone git://github.com/squirly/eece411-kvclient.git
cd eece411-kvclient
To run the tests:
python setup.py test
To contribute changes, make a pull request on Github.