
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
pydilite
Advanced tools
pydilite is a lightweight dependency injection library for python supporting both sync and async functions.
It is strongly based on ![pythondi]
pip install pydilite
poetry add pydilite
from pydilite import Provider
provider = Provider()
provider.bind(Repo, SQLRepo)
provider.bind(Usecase, CreateUsecase)
After binding, configure the provider to the container
from pydilite import configure, configure_after_clear
# Inject with configure
configure(provider=provider)
# Or if you want to fresh inject, use `configure_after_clear`
configure_after_clear(provider=provider)
Define the kind of injection you want to use on your clases.
Import inject
from pydilite import inject
Add type annotations that you want to inject dependencies
class Usecase:
def __init__(self, repo: Repo):
self.repo = repo
Add decorator
class Usecase:
@inject()
def __init__(self, repo: Repo):
self.repo = repo
Initialize the destination class with no arguments as they are being injected automatically.
usecase = Usecase()
Or, you can also inject manually through decorator arguments
class Usecase:
@inject(repo=SQLRepo)
def __init__(self, repo):
self.repo = repo
In this case, do not have to configure providers and type annotation.
Using lazy initilization the injected classes will be built when used. It can be used to preinitialize a class with parameters in the constructor.
from pydilite import Provider
provider = Provider()
provider.bind(Repo, SQLRepo, lazy=True)
You can use lazy initializing through lazy option. (default False)
For singleton, use lazy=False.
class Usecase:
@inject(repo=SQLRepo)
def __init__(self, repo):
self.repo = repo
By default, manual injection is lazy. If you want a singleton, instantiate it like repo=SQLRepo().
FAQs
Python lightweight dependency injection framework
We found that pydilite 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.