Code Monkey home page Code Monkey logo

taskee's Introduction

taskee logo

Earth Engine Python PyPI version CI

taskee is a command-line tool for monitoring Google Earth Engine tasks that can send notifications to your phone or computer to let you know when your tasks finish.

Features

  • ๐Ÿ” Monitor Google Earth Engine tasks created with the Python API and/or the Javascript Code Editor
  • ๐Ÿ’ป Native notifications for Linux, Mac, and Windows
  • ๐Ÿ’ฌ Mobile push notifications for Android
  • ๐Ÿ“บ Built-in CLI dashboard

Setup

pip install taskee

Run the setup steps below as needed.

Earth Engine (required) Set up a Google Earth Engine account. If you haven't authenticated Earth Engine before, you'll be asked to do so the first time you run taskee.

Pushbullet (optional) If you want to receive mobile notifications (Android only), you'll need to create or connect an account with Pushbullet, download the app on your device(s), and install the Pushbullet Python API using pip install pushbullet.py. Once Pushbullet is installed and you're logged in, go to your Account Settings, create an Access Token, and copy the API key. The first time you run taskee with a pushbullet notifier, you'll need to enter your API key. That key will be stored locally so you don't have to enter it again.

notify-send (Linux only) Linux users may need to install notify-send to enable native notifications. If taskee is not working with the native notifier, run sudo apt install libnotify-bin.

Usage

taskee offers a few different commands which you can see by running taskee --help.

Usage: taskee [OPTIONS] COMMAND [ARGS]...

  Monitor Earth Engine tasks and send notifications when they change states.

  Examples
      $ taskee test
      $ taskee tasks
      $ taskee start log
      $ taskee start dashboard failed completed -n pushbullet -i 0.5

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  start  Start running the notification system.
  tasks  Display a table of current Earth Engine tasks.
  test   Send test notifications.

Starting taskee

The taskee start command initializes and runs the notification system. It will continue running until you cancel it, periodically checking your Earth Engine tasks and sending you notifications.

taskee start requires one argument: mode.

Choosing a Mode

There are two modes that taskee start can run in: dashboard and log.

dashboard shows a live-updating dashboard that makes it easy to visually keep track of your tasks and events.

taskee start dashboard

A dashboard showing live-updating tasks and events

log is designed to be run in the background and prints minimal logs as events occur.

taskee start log

A terminal showing logs of new events.

Filtering Events

There are a lot of possible events that can happen to Earth Engine tasks. The list below describes the events recognized by taskee.

Event Description
created ๐ŸŒฑ A new task is submitted.
started ๐ŸŒฟ A task starts processing.
attempted ๐Ÿ‚ An attempt fails and the task is restarted.
completed ๐ŸŒฒ A task finished successfully.
failed ๐Ÿ”ฅ A task fails to complete.
cancelled ๐Ÿช“ The user cancels the task.
error โ— taskee crashes.

By default, taskee will notify you of errors and completed or failed tasks, but you can specify which events to watch for by listing them when you launch taskee. For example:

taskee start dashboard failed attempted cancelled error

You can also use all as a shortcut and taskee will notify you of all events.

taskee start dashboard all

Selecting Notifiers

By default, taskee will use the native notification system built into your computer's operating system.

If you want notifications on other devices, set up Pushbullet and then select it with the -n --notifier option.

taskee start dashboard --notifier pushbullet

Like with events, you can use all as a shortcut and taskee will send both native and pushbullet notifications.

taskee start dashboard -n all

Other Options

You can set how often tasks are re-checked (in minutes) using the -i --interval_mins option.

taskee start dashboard -i 10

Warning
taskee doesn't set a minimum interval, but if updates occur too frequently you may run into rate limits for Earth Engine or Pushbullet.

Service Credentials

By default, taskee uses the persistent credentials stored on your local machine (whichever account you authenticated last). To use a service account instead, pass the relative path to your private key file using the -k --private-key option.

taskee start dashboard -k path/to/private-key.json

Example

Using what we learned above, let's set up taskee to start running in log mode, check for cancelled or completed task events, send us notifications using pushbullet, and update every 30 minutes.

taskee start log cancelled completed -n pushbullet -i 30

Other Commands

Aside from running the notification system, taskee has a few more commands that may be helpful.

Task Summaries

The tasks command checks your Earth Engine tasks once, giving you a snapshot of your current tasks in a nice, readable table.

taskee tasks

A table showing details for a list of tasks.

Test Notifications

The test command sends a mock notification to any notifiers selected with the -n --notifier option. You can use this to make sure notifications are set up and working.

taskee test -n native

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.