Skip to content

Slack

This will post a message to slack with statistics about the opendata bucket. Intended to be run monthly.

Usage

Run as user pam on cetacean.shore.mbari.org

python opendata/run.py slack_post [options]

Options can be seen with the --help option, e.g. python opendata/run.py opendata slack_post --help

Usage

Two environment variables are needed to post, SLACK_WEBHOOK_URL and SLACK_CHANNEL. These can be set in the cron tab. See the deploy-soundscape repository for details. To test, you can set them in your shell environment.

export SLACK_BOT_TOKEN=xoxb..
export SLACK_CHANNEL=soundscape-analysis

python opendata/run.py slack_post --start 2022-04 --out /PAM_Analysis/

Options can be seen with the --help option, e.g. opendata slack_post --help

  Query opendata access logs for high-level view of total downloads, unique ip
  addresses of accessors, etc.

Options:
  --start TEXT  Year and month to post in date in yyyy-mm format
  --out TEXT    Absolute path to query for csv files with the stats
  -h, --help    Show this message and exit.