pytimer2


Namepytimer2 JSON
Version 0.2.4 PyPI version JSON
download
home_pagehttps://github.com/attiqRahman/pytimer
SummaryPyTimer is a lightweight and easy-to-use Python package designed to provide countdown timer functionality. It offers a simple class-based approach to manage countdowns, making it perfect for various use cases such as timing events, tracking intervals, or managing delays in scripts and applications.
upload_time2024-09-11 08:53:45
maintainerNone
docs_urlNone
authorAtiqur Rahman
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyTimer2

`PyTimer2` is a simple Python countdown timer package that offers start, pause, resume, and stop functionalities. This tool is perfect for managing timed tasks, creating simple scheduling systems, or integrating into larger applications where precise countdown control is required.

[![Downloads](https://static.pepy.tech/badge/pytimer2)](https://pepy.tech/project/pytimer2)  
## Features

- **Start Countdown:** Initiate a countdown for a specified duration.
- **Pause Countdown:** Pause the countdown at any moment without losing the current time.
- **Resume Countdown:** Resume the countdown from where it was paused.
- **Stop Countdown:** Completely stop the countdown and reset the timer.
- **Non-Blocking Execution:** Runs in a separate thread, allowing your main application to continue running without interruption.

## Installation

You can install PyTimer directly from GitHub or from PyPI:

```bash
# Install pytimer2
pip install pytimer2

# Usage
from pytimer2 import Timer
import time

# Create a Timer instance
timer = Timer()

# Start the countdown with a duration of 500 seconds
timer.start_countdown(duration=500)

# Access the current countdown value
print(f"Current countdown: {timer.get_countdown()} seconds")

# Let it run for a few seconds and then pause
time.sleep(3)
timer.pause_countdown()
print(f"Countdown paused: {timer.get_countdown()} seconds")

# Wait and then resume the countdown
time.sleep(5)
print(f"Countdown still paused: {timer.get_countdown()} seconds")
timer.resume_countdown()
print("Timer resumed...")

# Run for a few more seconds
time.sleep(2)
print(f"Countdown resumed and current time: {timer.get_countdown()} seconds")

# Stop the countdown
timer.stop_countdown()
print(f"Countdown stopped at: {timer.get_countdown()} seconds")






            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/attiqRahman/pytimer",
    "name": "pytimer2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Atiqur Rahman",
    "author_email": "rahman.md.attiq@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d6/70/74b1a315c678fcc753a9d3f6ef3f20661f09136ea693cb1372161942fe69/pytimer2-0.2.4.tar.gz",
    "platform": null,
    "description": "# PyTimer2\n\n`PyTimer2` is a simple Python countdown timer package that offers start, pause, resume, and stop functionalities. This tool is perfect for managing timed tasks, creating simple scheduling systems, or integrating into larger applications where precise countdown control is required.\n\n[![Downloads](https://static.pepy.tech/badge/pytimer2)](https://pepy.tech/project/pytimer2)  \n## Features\n\n- **Start Countdown:** Initiate a countdown for a specified duration.\n- **Pause Countdown:** Pause the countdown at any moment without losing the current time.\n- **Resume Countdown:** Resume the countdown from where it was paused.\n- **Stop Countdown:** Completely stop the countdown and reset the timer.\n- **Non-Blocking Execution:** Runs in a separate thread, allowing your main application to continue running without interruption.\n\n## Installation\n\nYou can install PyTimer directly from GitHub or from PyPI:\n\n```bash\n# Install pytimer2\npip install pytimer2\n\n# Usage\nfrom pytimer2 import Timer\nimport time\n\n# Create a Timer instance\ntimer = Timer()\n\n# Start the countdown with a duration of 500 seconds\ntimer.start_countdown(duration=500)\n\n# Access the current countdown value\nprint(f\"Current countdown: {timer.get_countdown()} seconds\")\n\n# Let it run for a few seconds and then pause\ntime.sleep(3)\ntimer.pause_countdown()\nprint(f\"Countdown paused: {timer.get_countdown()} seconds\")\n\n# Wait and then resume the countdown\ntime.sleep(5)\nprint(f\"Countdown still paused: {timer.get_countdown()} seconds\")\ntimer.resume_countdown()\nprint(\"Timer resumed...\")\n\n# Run for a few more seconds\ntime.sleep(2)\nprint(f\"Countdown resumed and current time: {timer.get_countdown()} seconds\")\n\n# Stop the countdown\ntimer.stop_countdown()\nprint(f\"Countdown stopped at: {timer.get_countdown()} seconds\")\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "PyTimer is a lightweight and easy-to-use Python package designed to provide countdown timer functionality. It offers a simple class-based approach to manage countdowns, making it perfect for various use cases such as timing events, tracking intervals, or managing delays in scripts and applications.",
    "version": "0.2.4",
    "project_urls": {
        "Homepage": "https://github.com/attiqRahman/pytimer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f4381a2608e1e8d1844616e80c5b244cdfbff632dcf872959cc469e4bdd828f",
                "md5": "e6b54e24d5c17a1589390e0b2a6b58b2",
                "sha256": "b5c7cb87cac07134b1fcc481a2f051f48daf1b6ef1ddb810dd91c2aa70ca31e6"
            },
            "downloads": -1,
            "filename": "pytimer2-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6b54e24d5c17a1589390e0b2a6b58b2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3531,
            "upload_time": "2024-09-11T08:53:44",
            "upload_time_iso_8601": "2024-09-11T08:53:44.067380Z",
            "url": "https://files.pythonhosted.org/packages/7f/43/81a2608e1e8d1844616e80c5b244cdfbff632dcf872959cc469e4bdd828f/pytimer2-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d67074b1a315c678fcc753a9d3f6ef3f20661f09136ea693cb1372161942fe69",
                "md5": "c01d4953a0ad27b1b9d551df175b1c17",
                "sha256": "5ed0456051285c03e388b13e46e07c6f372518162b4d77b6d361c9d1a0a87f98"
            },
            "downloads": -1,
            "filename": "pytimer2-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "c01d4953a0ad27b1b9d551df175b1c17",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3174,
            "upload_time": "2024-09-11T08:53:45",
            "upload_time_iso_8601": "2024-09-11T08:53:45.482898Z",
            "url": "https://files.pythonhosted.org/packages/d6/70/74b1a315c678fcc753a9d3f6ef3f20661f09136ea693cb1372161942fe69/pytimer2-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-11 08:53:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "attiqRahman",
    "github_project": "pytimer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pytimer2"
}
        
Elapsed time: 0.86003s