Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
BumBag is a collection of Python utility functions:
bumbag
is available on PyPI for Python 3.8+:
pip install bumbag
Measure elapsed wall-clock time and compute total elapsed time with stopwatch
:
>>> import bumbag
>>> import time
>>> with bumbag.stopwatch(1) as sw1:
... time.sleep(1)
...
2023-01-01 12:00:00 -> 2023-01-01 12:00:01 = 1.00124s - 1
>>> with bumbag.stopwatch(2) as sw2:
... time.sleep(1)
...
2023-01-01 12:01:00 -> 2023-01-01 12:01:01 = 1.00168s - 2
>>> sw1 + sw2
2.00291s - total elapsed time
Easily flatten
an irregular list:
>>> import bumbag
>>> irregular_list = [
... ["one", 2],
... 3,
... [(4, "five")],
... [[["six"]]],
... "seven",
... [],
... ]
>>> list(bumbag.flatten(irregular_list, 8, [9, ("ten",)]))
['one', 2, 3, 4, 'five', 'six', 'seven', 8, 9, 'ten']
Use highlight_string_differences
to see differences between two strings easily:
>>> import bumbag
>>> print(bumbag.highlight_string_differences("hello", "hall"))
hello
| |
hall
Quickly compare two Python sets with two_set_summary
:
>>> import bumbag
>>> x = {"a", "c", "b", "g", "h"}
>>> y = {"c", "d", "e", "f", "g"}
>>> summary = bumbag.two_set_summary(x, y)
>>> print(summary["report"])
x (n=5): {'a', 'b', 'c', ...}
y (n=5): {'c', 'd', 'e', ...}
x | y (n=8): {'a', 'b', 'c', ...}
x & y (n=2): {'c', 'g'}
x - y (n=3): {'a', 'b', 'h'}
y - x (n=3): {'d', 'e', 'f'}
x ^ y (n=6): {'a', 'b', 'd', ...}
jaccard = 0.25
overlap = 0.4
dice = 0.4
disjoint?: False
x == y: False
x <= y: False
x < y: False
y <= x: False
y < x: False
Your contribution is greatly appreciated! See the following links to help you get started:
bumbag
was created by the BumBag Developers.
It is licensed under the terms of the BSD 3-Clause license.
FAQs
A package for Python utility functions.
We found that bumbag 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.