rdbtools3
— Parser API¶
Parser¶
-
rdbtools3.
parse_rdb_stream
(f, skip_db=lambda dbnum: False, skip_key_type=lambda dbnum, key_type: False, skip_key=lambda dbnum, key_type, key: False)¶ Parameters: - f (file) – File stream
- skip_db (function) – callback to check if db should be skipped.
- skip_key_type (function) – callback to check if key type should be skipped.
- skip_key (function) – callback to check if key should be skipped.
Returns: generator that yields
RDBItem
‘sReturn type: generator
Raises: - rdbtools3.FileFormatError – if read invalid magic string, unsupported RDB version or no “select db” code found.
- rdbtools3.RDBValueError – if parser encounters unexpected data value.
Parses Redis dump file stream.
RDBItem¶
-
class
rdbtools3.
RDBItem
(dbnum, key_type, key, value, expire, info)¶ Parameters: Named tuple representing Redis DB item.
Exceptions¶
-
exception
rdbtools3.
ParserError
¶ Base parser exception type.
Subclass of
ValueError
.
-
exception
rdbtools3.
FileFormatError
(msg)¶ Raised if magic string is invalid, RDB version number invalid or not supported or no “select db” control code found.
-
exception
rdbtools3.
RDBValueError
(msg)¶ Raised if unexpected value received.