Skip to main content

You can use `TaskTimer` to automatically calculate when a given task will be executed based on a specified duration in seconds.

Project description

TaskTimer

TaskTimer is a Python class used to schedule and keep track of upcoming actions. You can use TaskTimer to automatically calculate when a given action will be executed based on a specified duration in seconds.

Usage

To use the TaskTimer class, you need to initialize an instance of the class with an action and the amount of seconds until the action will be executed.

from task_timer import TaskTimer

Initialize a new ActionScheduler

task_timer = TaskTimer('send_email', 3600)

Print the next action time in a human-friendly format

print(task_timer.human_friendly())

Print the next action time as a datetime object

print(str(task_timer))

Print all upcoming actions

print(TaskTimer.get_upcoming_actions())

In the example above, 'send_email' is the action we're scheduling, and 3600 is the number of seconds until the action will be executed.

Installation

This package can be installed using pip:

pip install task-timer

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

task_timer_birdhouses-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

task_timer_birdhouses-0.0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file task_timer_birdhouses-0.0.1.tar.gz.

File metadata

  • Download URL: task_timer_birdhouses-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.10.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.65.0 urllib3/1.26.15 CPython/3.10.6

File hashes

Hashes for task_timer_birdhouses-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c92caca418f9f10be7f3a05a289fde73fb2149923b498ca3fd2c35f547353139
MD5 555554341c0707551de6349e34a944a9
BLAKE2b-256 9758489ba2b14e0bf4120cee8fcf0c268e9e877c66781b12b7b8b54c4d352ecd

See more details on using hashes here.

File details

Details for the file task_timer_birdhouses-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: task_timer_birdhouses-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.10.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.65.0 urllib3/1.26.15 CPython/3.10.6

File hashes

Hashes for task_timer_birdhouses-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1e5cf08e86ad424584387bcb6144598761a60b7877a3819e1b39ab300ddf16f
MD5 13016431b6a39b1a9eab8d84c0c052ec
BLAKE2b-256 8f3e475a63ccafdcb885eebeed1e6e9960431b630266353a3a9db02426dc8fca

See more details on using hashes here.

Supported by

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