Python-native Aerospike client

query-key.py 338B

1234567891011121314
  1. import sys, socket
  2. from pprint import pprint
  3. from aerospike_py.connection import SocketConnection
  4. from aerospike_py.client import AerospikeClient
  5. hostname = sys.argv[1]
  6. namespace = sys.argv[2]
  7. key = sys.argv[3]
  8. cli = AerospikeClient(SocketConnection(socket.create_connection((sys.argv[1], 3000))))
  9. pprint(cli.get(namespace, '', key))