
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Track progress of long-running scripts, without cluttering your code with log statements.
Track progress of long-running scripts, without cluttering your code with log statements.
cleantimer is a minimal wrapper around a couple of my favorite packages for timing scripts - contexttimer and tqdm. It merges their most useful features in a clean API based simply on the way I've found I like to use them. Hopefully you find it simply useful. 😊
pip install cleantimer
from cleantimer import CTimer
with CTimer("Waking up"):
sleep(4)
Waking up (3:22PM)...done. (4.0s)
with CTimer("Waking up", 3):
sleep(4.123456)
Waking up (3:22PM)...done. (4.123s)
with CTimer("Making breakfast") as timer:
sleep(2)
with timer.child("cooking eggs") as eggtimer:
sleep(3)
with timer.child("pouring juice"):
sleep(1)
Making breakfast (3:22PM)...
cooking eggs (3:22PM)...done. (3.0s)
pouring juice (3:23PM)...done. (1.0s)
done. (6.0s)
df = pd.DataFrame({"A": list(range(10000))})
def times2(row): return row["A"] * 2
with CTimer("Computing doubles") as timer:
df["2A"] = timer.progress_apply(df, times2)
Computing doubles (3:22PM)...
: 100% ██████████████████████████ 10000/10000 [00:07<00:00, 135869it/s]
done. (7.4s)
df = pd.DataFrame({"A": list(range(10000)), "type": [1]*5000 + [2]*5000})
def times2(row): return row["A"] * 2
with CTimer("Computing doubles") as timer:
df["2A"] = timer.progress_apply(df, times2, split_col="type", message="part {}")
Computing doubles (3:22PM)...
part 1: 100% ██████████████████████████ 5000/5000 [00:07<00:00, 135869it/s]
part 2: 100% ██████████████████████████ 5000/5000 [00:07<00:00, 122854it/s]
done. (8.2s)
FAQs
Track progress of long-running scripts, without cluttering your code with log statements.
We found that cleantimer 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
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.