Skip to main content

PyPI

prefect-client

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.

Getting started

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()

Known limitations

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.

Next steps

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.

Join the community

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.

Contribute

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!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prefect_client-3.8.2.tar.gz (925.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prefect_client-3.8.2-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file prefect_client-3.8.2.tar.gz.

File metadata

  • Download URL: prefect_client-3.8.2.tar.gz
  • Upload date:
  • Size: 925.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prefect_client-3.8.2.tar.gz
Algorithm Hash digest
SHA256 c9bcc87872b05e65ca789bfd330a7bd38137b1a0e535f90134118e30e54f67b5
MD5 5cb23bb9a914a2a531171c905d9158de
BLAKE2b-256 cf32eb64775467a6052a8b994c2d70f2a1f5c2da707127b22a26b04e14a37934

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefect_client-3.8.2.tar.gz:

Publisher: prefect-client-publish.yaml on PrefectHQ/prefect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prefect_client-3.8.2-py3-none-any.whl.

File metadata

  • Download URL: prefect_client-3.8.2-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prefect_client-3.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f150ec1968a1e19daf2e2d5e43db305943f821c57611e95274bbd4a79cc1de7
MD5 55d7f16edb61284f13c813e7c5865ea1
BLAKE2b-256 2ce9ef51de8234cfa8374498a54f05f2fdc6853020f9f030852b872bc6a7ce6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefect_client-3.8.2-py3-none-any.whl:

Publisher: prefect-client-publish.yaml on PrefectHQ/prefect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.8.2

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page