aerospike_helpers — Aerospike Helper Package for bin operations (list, map, bit, etc.), and metrics

This package contains:

  • Helpers to be used by the operate and operate_ordered methods for bin operations. (list, map, bitwise, etc.)

  • Classes for metrics callbacks.

  • The HyperLogLog data type

class aerospike_helpers.HyperLogLog(o)

Bases: bytes

Represents a HyperLogLog value. This can be returned from or sent to the server.

from aerospike_helpers.operations import hll_operations
import aerospike

client = aerospike.client({'hosts': [('localhost', 3000)]})

BIN_NAME="hll"
ops = [
    hll_operations.hll_init(BIN_NAME, index_bit_count=4, mh_bit_count=4)
]
keyTuple = ("test", "demo", 1)
client.operate(keyTuple, ops)
_, _, bins = client.get(keyTuple)
print(bins[BIN_NAME])

client.put(keyTuple, bins)
_, _, bins = client.get(keyTuple)
print(bins[BIN_NAME])
HyperLogLog(...)
HyperLogLog(...)
class aerospike_helpers.string_helpers.NumericType(*values)

Bases: IntEnum

Numeric type filter for is_numeric().

ANY = 0

Match either an integer or a floating-point number.

FLOAT = 2

Match only floating-point numbers.

INT = 1

Match only integers.

class aerospike_helpers.string_helpers.RegexFlags(*values)

Bases: IntEnum

Regex flags for string regex operations. Use bitwise OR to combine flags.

CASE_INSENSITIVE = 1

Case insensitive matching.

DEFAULT = 0

Default. No flags set.

DOTALL = 4

The dot metacharacter matches line terminators.

GLOBAL = 16

Replace all matches. Only applicable to regex_replace().

MULTILINE = 2

Treat input as a multi-line string. The ^ and $ metacharacters match the start and end of any line, not just the start and end of the input.

UNIX_LINES = 8

Treat only \n as a line terminator.

class aerospike_helpers.string_helpers.StringPolicy(write_flags: WriteFlags)

Bases: object

String operation policy.

class aerospike_helpers.string_helpers.WriteFlags(*values)

Bases: IntEnum

String operation policy write bit flags. Use bitwise OR to combine flags.

DEFAULT = 0

Default. Allow create or update.

NO_FAIL = 4

Do not raise an error if a modify operation cannot be applied because the target bin does not exist. The record is left unchanged.

Subpackages