saver package¶
saver module¶
-
class
mindreader.saver.saver.Saver(database_url)¶ Bases:
object-
run_all_savers(mq_url: str, debug: bool = False)¶ Runs the saver as a service, so it listens on the queue, and saves the data received to the database.
- Parameters
mq_url – Receives a url to a message queue, and consumes data from all available parsers.
debug – if enabled, each data will be printed before saved to the database.
-
run_saver(topic: str, mq: mindreader.drivers.message_queues.message_queue.MessageQueue, debug=False)¶ Registers to a message queue on a single parser type, received snapshot parsing results, and saves them to the database.
- Parameters
topic – The type of parsed data it consumes (user, pose, etc).
mq – A message queue. Note that it should already be initialized (not a url).
debug – if enabled, each data will be printed before saved to the database.
-
save(topic: str, data: str, debug: bool = False)¶ Saves data to the database.
- Parameters
topic – The type of the data (user, pose, etc).
data – The data, in JSON format.
debug – if enabled, the data will be printed before saved to the database.
-
CLI¶
python -m mindreader.saver¶
python -m mindreader.saver [OPTIONS] COMMAND [ARGS]...