
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Productivity-Timer is a Python library for managing multiple timers, one for each specified individual. It allows starting, stopping, pausing, resuming, resetting, and retrieving elapsed times for timers on a per-person basis. The library also supports optional timeouts, so timers can automatically stop after reaching a specified duration.
To install Productivity-Timer, use pip
:
pip install productivity-timer
from productivity_timer import ProductivityTimer
from productivity_timer import ProductivityTimer
timer = ProductivityTimer()
timer.start("Abhishek", timeout=10)
timer.start("Ram")
timer.pause("Abhishek")
timer.resume("Abhishek")
timer.stop("Ram")
print(f"Elapsed time for Abhishek: {timer.get_elapsed_time('Abhishek', formatted=True)}")
timer.stop_all()
print(timer)
start(person, timeout=None)
Starts a timer for the specified person. If a timer for this person already exists, it resumes the timer. The timeout
argument sets a maximum duration for the timer (in seconds).
stop(person)
Stops the timer for the specified person and updates the total elapsed time.
pause(person)
Pauses the timer for the specified person without resetting the elapsed time. The timer can be resumed later.
resume(person)
Resumes a paused timer for the specified person.
reset(person)
Resets the timer for the specified person to zero, clearing any elapsed time.
get_elapsed_time(person, formatted=False)
Returns the elapsed time for the specified person. If formatted=True
, the time is returned as a formatted string in HH:MM:SS
.
get_all_elapsed_times(formatted=False)
Returns a dictionary of elapsed times for all tracked persons. If formatted=True
, times are formatted in HH:MM:SS
.
stop_all()
Stops all active timers.
reset_all()
Resets all timers, clearing any elapsed times.
check_timeouts()
Checks each timer against its timeout value (if any). If a timer's elapsed time exceeds its timeout, the timer is automatically stopped.
timer.start("Abhishek", timeout=30)
timer.stop_all()
formatted_time = timer.get_elapsed_time("Abhishek", formatted=True)
print(f"Elapsed time for Abhishek: {formatted_time}")
Contributions are welcome! If you would like to report issues, suggest new features, or contribute code, please create a pull request or open an issue on the GitHub repository.
FAQs
A timer library for managing multiple timers for multiple individuals.
We found that productivity-timer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.