Skip to content

REPL

The following command provides you with an interface to a BovineClient for comfortable use through a REPL. Either a config file or domain and secret (an Ed25519 private key) must be specified. By default the config file bovine_user.toml will be used. It has the format

bovine_user.toml
domain = "DOMAIN"
secret = "ed25519 private key"

Using the repl requires the ptpython package, which can be installed via bovine[repl].

python -m bovine.repl

Opens a REPL with preloaded BovineClient client

Usage:

python -m bovine.repl [OPTIONS]

Options:

  --domain TEXT         Domain the actor can be found on
  --secret TEXT         Secret associated with the account
  --config_file TEXT    Toml fail containing domain and secret
  --inbox               Display the inbox
  --outbox              Display the outbox
  --summary             Display a summary of the activity instead of the full
                        json
  --max_number INTEGER  Number of elements to display in inbox or outbox
  --help                Show this message and exit.

Example usage:

>>> remote_id = (await client.proxy_element('helge@mymath.rocks'))["id"]
>>> note = object_factory.note(to={remote_id}, content="moooo").build()
>>> create = activity_factory.create(note).build()
>>> await client.send_to_outbox(create)