This is a native Python client implementation of Infinispan’s Hot Rod client/server protocol, which allows Python applications to connect and query or store data in Infinispan remote caches based on Hot Rod.
In order to connect to Hot Rod based Infinispan remote caches, it’s necessary that a server is up and running. To find out more on how to start an Infinispan remote cache server, follow the instructions on using the Infinispan Hot Rod server.
Installing the python client is a very simple process. Once you’ve downloaded the source bundle for the client, execute the following:
python setup.py install --record files.txt
To install the Infinispan python client via a python egg, simply type (please note than in some systems, i.e. MacOS, you’ll have to execute this as super user (sudo)):
pip install infinispan
Once you’ve installed the client, testing it is very easy. First of all download one of the Infinispan *-bin.zip distributions and start a Hot Rod server using default values. Then, execute a simple script such as this:
import sys from infinispan.remotecache import RemoteCache def main(): remote_cache = RemoteCache() remote_cache.put("Name", "Galder") name = remote_cache.get("Name") print "My name is %s" % name return if __name__ == "__main__": sys.exit(main())
When you run this script, the output should say:
> My name is Galder
If you executed the suggested installation a command, a file called
files.txt would have been generated. This file can later be used to uninstall the client using the following command:
cat files.txt | xargs rm -rf
1.0.0b1 - This version provides a client intelligence level 1 implementation for the Infinispan Hot Rod protocol. Please read the specification in order to find out more.
Contributions, as always, are welcome be it in the form of code, tests or documentation.