Help › Work in notebooks

Send a notebook's results to Slack, email or a sheet

Have a scheduled or command-line run of a notebook post its outcome to Slack, mail its report, or write a result into a Google Sheet.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

A run of a notebook can send what it made somewhere: a message to a Slack channel, an email with the report, or a result's rows into a Google Sheet. You save each place once as a destination, and then choose destinations in a schedule or name them on the command line.

Every delivery goes from your computer straight to the service you named. Nothing passes through querlyn.com.

Delivery has been tested against stand-ins of Slack, a mail server and Google Sheets on a developer's computer, not yet against the real services.

Add a destination

Notebook › Delivery Destinations… (Notebook › Delivery Destinations…) lists your destinations. Add Slack…, Add Email… and Add Google Sheet… each open a form; Change… opens a destination's form again, and Remove, then Remove Destination, forgets it and its secret.

A destination's name is what a schedule and the command line call it.

What each destination needs

Slack takes the address of an incoming webhook, which you make in Slack for one channel. Whoever has that address can post to the channel, so Querlyn keeps it in your computer's credential store, not in its own files, and shows it nowhere after you save it.

Email takes your mail server: its host name, port and security, the user and password to sign in with, the sender's address and the recipients. The password is kept in your credential store.

  • Security is TLS (usually port 465) or STARTTLS (usually port 587). Either way the server's certificate is checked, and Querlyn sends nothing, not even the sign-in, to a server it could not verify or that offers no encryption. A company's own certificate authority goes in CA file.
  • An HTML report is attached, or is the message itself when you choose that.

Google Sheet takes the sheet's address, the name of one of its tabs, and how to sign in: a service account's key file (share the sheet with the service account's address as an editor), or, with no key file, the Google Cloud CLI's own sign-in, which must have been given access to Sheets. Querlyn keeps no Google password or token.

  • Replace what the tab holds clears the tab and writes the column names and the rows. Add rows under what the tab holds keeps a history: each run adds its rows.
  • Cells are written as plain values. Text that starts with = stays text; it never becomes a formula.

What is delivered

In Notebook › Schedule…, tick a destination under Deliver to and choose what it gets:

The reportA result
SlackHow the run ended and each cell's ending. A webhook carries no file, so the report is named, not sent.The result's first rows as text
EmailThe same, with the report attached or as the messageA table of the first rows, and every saved row as a CSV file
Google SheetNot possible: a sheet takes rowsThe result's saved rows

A result is one of the notebook's results, by its name. What is delivered of it is what the notebook saves of it: the rows within the notebook's bound.

Masked columns stay masked: their values are never sent, and the delivered table shows •••••• in their place.

A run that failed is delivered too, and says so.

From the command line

querlyn notebook run delivers with --deliver <destination> (the report) and --deliver-result <result>=<destination>, each as often as you like:

querlyn notebook run reports/daily.ipynb --report reports/daily.html \
  --deliver "Ops mail" --deliver-result top_customers="Team alerts"

The command names destinations; it never holds a webhook or a password.

When a delivery fails

A delivery that fails does not undo the run: the notebook and its report are written. The command says which delivery failed and why, and ends with exit code 7. For a schedule, Notebook › Scheduled Runs… shows each delivery of the last run, delivered or not, with the reason.

Help for Querlyn 0.1.0. All help topics