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 TaskTimer
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
Built Distribution
File details
Details for the file task_timer_birdhouses-0.0.4.tar.gz
.
File metadata
- Download URL: task_timer_birdhouses-0.0.4.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98e5581524d610666aa9702d276290ebc3ff69d8bc0c68cb61835efe694f9bbc |
|
MD5 | 6cc4e013737bb04a336244b6c0286ed4 |
|
BLAKE2b-256 | 314c2259081d97d152346bc6c922a996af17a7d0d8236e4d9f64e2f16ef7f35c |
File details
Details for the file task_timer_birdhouses-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: task_timer_birdhouses-0.0.4-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3484d14a38c01a423b2ed6cb2621ef6807937efd2ca3645532942927922a8f07 |
|
MD5 | 3ab0733cfb48f89af6fa7aedb4c6ae54 |
|
BLAKE2b-256 | c99909565626ceab7339c6352955c29a9885e0e9b2ef0a3d52a4c02345e394f5 |