client package

client module

mindreader.client.client.generate_snapshot_address(host: str, port: int) → str

Generates the snapshot target address according to the protocol.

mindreader.client.client.send_snapshot(host: str, port: int, snapshot: mindreader.objects.snapshot.Snapshot, user: mindreader.objects.user.User)

Sends a single snapshot to the server.

mindreader.client.client.upload_sample(host: str, port: int, path: str, file_format: str = 'protobuf', limit: int = 0)

Reads snapshots from a file, and sends them to the server. If all the snapshots were sent successfully to the server, or the function operation was interrupted, prints an appropriate message.

Parameters
  • host – host of the server.

  • port – port of the server.

  • path – path to the file (relative or absolute).

  • file_format – the format of the file provided, default is ‘pb’ (protobuf).

  • limit – limit the number of snapshots that can be sent to server. If 0, it has no effect

Raises
  • FileNotFoundError – path to sample does not exist.

  • NotImplementedError – sample format is not supported.

  • ConnectionRefusedError – can’t connect to server.

  • ConnectionError – server returned a bad response.

CLI

python -m mindreader.client

python -m mindreader.client [OPTIONS] COMMAND [ARGS]...

upload-sample

python -m mindreader.client upload-sample [OPTIONS] PATH

Options

-h, --host <host>

Server host

-p, --port <port>

Server port

-f, --file_format <file_format>

Format of the sample

-l, --limit <limit>

Limit the number of samples that can be sent

Arguments

PATH

Required argument