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.
A library that help you to manage events
pip install easy-events
GitHub : Github
text
from easy_events import EasyEvents
# create an event or use it in a class
client = EasyEvents()
# create another event (can be sync or async)
# you can put as much parameters as you want
@client.add_event(aliases="test1")
def test(arg1, arg2, *, arg3):
# data is the default parameter, it contain some basic informations that you can format as you want
print(arg1, arg2, arg3)
# trigger the event
client.trigger(data=test1, parameters="arg1 arg2 arg3 arg4")
client.trigger("test1", "arg1 arg2 arg3 arg4")
client.trigger("test1", ["arg1", "arg2", "arg3", "arg4"])
client.trigger("test1", {"arg1": "arg1", "arg2": "arg2", "arg3": ["arg3", "arg4"]})
# dict way
client.trigger({"event": "test1", "parameters": {"arg1": "arg1", "arg2": "arg2", "arg3": ["arg3", "arg4"]}})
# dict way v2
client.trigger({"event": "test", "parameters": ["arg1", "arg2", "arg3", "arg4"]})
# dict way v3
client.trigger({"event": "test1", "parameters": "arg1 arg2 arg3 arg4"})
# list way
client.trigger(["test", "arg1", "arg2", "arg3", "arg4"])
# str way
client.trigger("test arg1 arg2 arg3 arg4")
# the result will be (for all cases):
# arg1 = arg1
# arg2 = arg2
# arg3 = [arg3, arg4]
from easy_events import EasyEvents
client = EasyEvents()
@client.add_event()
def sum(X: int, Y: int):
return X+Y
client.trigger("sum 5 10")
client.trigger(["sum", "5", 10])
# the result will be 15
from easy_events import EasyEvents
class CTX:
def __init__(self, data: int = 0):
self.data = data
client = EasyEvents(default_context=CTX)
# client = EasyEvents(default_context=CTX(0)) works as well
@client.add_event()
def context(ctx):
print("ctx.data = ", ctx.data)
client.trigger("context", context=CTX(1))
client.trigger("context")
# this will print :
# "ctx.data = 1"
# "ctx.data = 0"
FAQs
An universal wrapper (and useful tool) to make event / commands in python
We found that easy-events 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.