Skip to main content

A Labtasker plugin that groups tasks according to recency.

Project description

labtasker-plugin-task-recency

A Labtasker plugin for retrieving tasks grouped by time chunks.

Overview

This plugin extends Labtasker's functionality by allowing you to retrieve tasks that occurred within specific time chunks. It groups tasks based on time intervals between consecutive tasks, making it easy to analyze and process tasks that were submitted in bursts.

Installation

pip install labtasker-plugin-task-recency

Usage

labtasker task recent [OPTIONS]

Options

Option Default Description
--by created_at The timestamp field to group tasks by. Options: created_at, start_time, last_heartbeat, last_modified
--interval, -i 5s Time interval to define chunks. Accepts duration strings like 1h, 1h30m, 50s
--k, -k 1 Which chunk to retrieve (1 is most recent, 2 is second most recent, etc.)
--order desc Sort order within each chunk. Options: desc (newest first), asc (oldest first)

Examples

  1. Get the most recent batch of tasks (tasks submitted with less than 5 seconds between them):

    labtasker task recent
    
  2. Get the second most recent batch of tasks:

    labtasker task recent --k 2
    
  3. Get tasks grouped by a 1-hour interval:

    labtasker task recent --interval 1h
    
  4. Get tasks grouped by their start time instead of creation time:

    labtasker task recent --by start_time
    
  5. Get the oldest batch of tasks:

    labtasker task recent --k 1 --order asc
    

How It Works

The plugin groups tasks into "chunks" based on the time gaps between consecutive tasks. If two tasks are submitted with a gap smaller than the specified interval, they belong to the same chunk. When the time gap exceeds the interval, a new chunk begins.

This approach is useful for identifying batches of tasks that were submitted together, allowing for easier management and analysis of task patterns.

Use Cases

  • Batch delete / update of most recently submitted tasks
    labtasker task recent | labtasker task delete -y
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labtasker_plugin_task_recency-0.1.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

labtasker_plugin_task_recency-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file labtasker_plugin_task_recency-0.1.1.tar.gz.

File metadata

File hashes

Hashes for labtasker_plugin_task_recency-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c96b1ba0749d926ea7254f1ededcebf360ef175c7f96c7728f7f8bea4b1d7c8b
MD5 6fcc8eb36f8a1092466d1718f566d68e
BLAKE2b-256 57ab63de359f3416831e98c88bc6a9c14e4378b1e7b57e1ebd9754d7a96c2738

See more details on using hashes here.

Provenance

The following attestation bundles were made for labtasker_plugin_task_recency-0.1.1.tar.gz:

Publisher: release.yml on luocfprime/labtasker-plugin-task-recency

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file labtasker_plugin_task_recency-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for labtasker_plugin_task_recency-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b6d40c429098962f6a685df2e876d9ce10906a512e876e8ea732ac69cceb93f
MD5 24bc10945d1df39d2c573ed36b070604
BLAKE2b-256 added9db1142798dd3333a7f8d274f96975a6fe711d76b0a3fd9285368555559

See more details on using hashes here.

Provenance

The following attestation bundles were made for labtasker_plugin_task_recency-0.1.1-py3-none-any.whl:

Publisher: release.yml on luocfprime/labtasker-plugin-task-recency

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page