reader package

reader module

class mindreader.drivers.reader.reader.Reader(path: str, file_format: str)

Bases: object

This class is used to reads users and snapshots from files. It serves as an interface to the available readers.

To add a new reader, add a file named <name>_file_reader.py to the sub-package file_readers with a class named <name>FileReader, which has an attribute named ‘prefix’ (string), that indicates the type of files it supports reading from. It should implement the functions below. Make sure you update the prefix you chose in ‘supported_dbs’ above.

close()
get_snapshot() → mindreader.objects.snapshot.Snapshot

Returns the next snapshot in the file.

get_user() → mindreader.objects.user.User

Returns the user associated to the file.

mindreader.drivers.reader.reader.load_readers()

Loads dynamically all the available file readers.

mindreader.drivers.reader.reader.supported_file_readers = {'protobuf': <class 'file_readers.protobuf_file_reader.ProtobufFileReader'>}

Mapping of the supported file formats, loaded dynamically. Currently available: Protobuf - ‘protobuf’