
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
prefect-client
Advanced tools
The prefect-client package is a minimal-installation of prefect which is designed for interacting with Prefect Cloud
or remote any prefect server. It sheds some functionality and dependencies in exchange for a smaller installation size,
making it ideal for use in lightweight or ephemeral environments. These characteristics make it ideal for use in lambdas
or other resource-constrained environments.
prefect-client shares the same installation requirements as prefect. To install, make sure you are on Python 3.10 or
later and run the following command:
pip install prefect-client
Next, ensure that your prefect-client has access to a remote prefect server by exporting the PREFECT_API_KEY
(if using Prefect Cloud) and PREFECT_API_URL environment variables. Once those are set, use the package in your code as
you would normally use prefect!
For example, to remotely trigger a run a deployment:
from prefect.deployments import run_deployment
def my_lambda(event):
...
run_deployment(
name="my-flow/my-deployment",
parameters={"foo": "bar"},
timeout=0,
)
my_lambda({})
To emit events in an event driven system:
from prefect.events import emit_event
def something_happened():
emit_event("my-event", resource={"prefect.resource.id": "foo.bar"})
something_happened()
Or just interact with a prefect API:
from prefect.client.orchestration import get_client
async def query_api():
async with get_client() as client:
limits = await client.read_concurrency_limits(limit=10, offset=0)
print(limits)
query_api()
By design, prefect-client omits all CLI and server components. This means that the CLI is not available for use
and attempts to access server objects will fail. Furthermore, some classes, methods, and objects may be available
for import in prefect-client but may not be "runnable" if they tap into server-oriented functionality. If you
encounter such a limitation, feel free to open an issue
describing the functionality you are interested in using and we will do our best to make it available.
There's lots more you can do to orchestrate and observe your workflows with Prefect! Start with our friendly tutorial or explore the core concepts of Prefect workflows.
Prefect is made possible by the fastest growing community of thousands of friendly data engineers. Join us in building a new kind of workflow system. The Prefect Slack community is a fantastic place to learn more about Prefect, ask questions, or get help with workflow design. All community forums, including code contributions, issue discussions, and Slack messages are subject to our Code of Conduct.
See our documentation on contributing to Prefect.
Thanks for being part of the mission to build a new kind of workflow system and, of course, happy engineering!
FAQs
Workflow orchestration and management.
We found that prefect-client 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
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.