# pyzor.engines.redis

Redis database engine.

class pyzor.engines.redis_.RedisDBHandle(fn, mode, max_age=None)

  Bases: `BaseEngine`

  absolute_source = False
  classmethod get_prefork_connections(fn, mode, max_age=None)

    Yields a number of database connections suitable for a Pyzor pre-fork server.

  handles_one_step = True
  items()

    Return a list of (key, record).

  iteritems()

    Iterate over pairs of (key, record).

  log = <Logger pyzord (WARNING)>
  report(*args, **kwargs)

    Report the corresponding key as spam, incrementing the report count.

    Engines that implement don’t implement this method should have handles_one_step set to False.

  whitelist(*args, **kwargs)

    Report the corresponding key as ham, incrementing the whitelist count.

    Engines that implement don’t implement this method should have handles_one_step set to False.

class pyzor.engines.redis_.ThreadedRedisDBHandle(fn, mode, max_age=None, bound=None)

  Bases: `RedisDBHandle`

pyzor.engines.redis_.decode_date(stamp)

  Return a datetime object from a Unix Timestamp.

pyzor.engines.redis_.encode_date(date)

  Convert the date to Unix Timestamp

pyzor.engines.redis_.safe_call(f)

  Decorator that wraps a method for handling database operations.