prefect-client


Nameprefect-client JSON
Version 2.19.5 PyPI version JSON
download
home_pagehttps://www.prefect.io
SummaryWorkflow orchestration and management.
upload_time2024-06-13 18:58:41
maintainerNone
docs_urlNone
authorPrefect Technologies, Inc.
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center"><img src="https://github.com/PrefectHQ/prefect/assets/3407835/c654cbc6-63e8-4ada-a92a-efd2f8f24b85" width=1000></p>

<p align="center">
    <a href="https://pypi.python.org/pypi/prefect-client/" alt="PyPI version">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-client?color=0052FF&labelColor=090422"></a>
    <a href="https://github.com/prefecthq/prefect/" alt="Stars">
        <img src="https://img.shields.io/github/stars/prefecthq/prefect?color=0052FF&labelColor=090422" /></a>
    <a href="https://pepy.tech/badge/prefect-client/" alt="Downloads">
        <img src="https://img.shields.io/pypi/dm/prefect-client?color=0052FF&labelColor=090422" /></a>
    <a href="https://github.com/prefecthq/prefect/pulse" alt="Activity">
        <img src="https://img.shields.io/github/commit-activity/m/prefecthq/prefect?color=0052FF&labelColor=090422" /></a>
    <br>
    <a href="https://prefect.io/slack" alt="Slack">
        <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack" /></a>
    <a href="https://discourse.prefect.io/" alt="Discourse">
        <img src="https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse" /></a>
    <a href="https://www.youtube.com/c/PrefectIO/" alt="YouTube">
        <img src="https://img.shields.io/badge/youtube-watch_videos-red.svg?color=0052FF&labelColor=090422&logo=youtube" /></a>
</p>

# 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.8 or 
later and run the following command:

```bash
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:

```python
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:

```python
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:
```python
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](https://github.com/PrefectHQ/prefect/issues/new/choose) 
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](https://docs.prefect.io/tutorials) or explore the [core concepts of Prefect workflows](https://docs.prefect.io/concepts/).

## 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](https://prefect.io/slack) 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](https://discourse.prefect.io/faq).

## Contribute

See our [documentation on contributing to Prefect](https://docs.prefect.io/contributing/overview/).

Thanks for being part of the mission to build a new kind of workflow system and, of course, **happy engineering!**



            

Raw data

            {
    "_id": null,
    "home_page": "https://www.prefect.io",
    "name": "prefect-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Prefect Technologies, Inc.",
    "author_email": "help@prefect.io",
    "download_url": "https://files.pythonhosted.org/packages/21/b7/aa8caa6aad7ca1e050d95680509f873f890fe149d1557bb6ad48bcf28e37/prefect-client-2.19.5.tar.gz",
    "platform": null,
    "description": "<p align=\"center\"><img src=\"https://github.com/PrefectHQ/prefect/assets/3407835/c654cbc6-63e8-4ada-a92a-efd2f8f24b85\" width=1000></p>\n\n<p align=\"center\">\n    <a href=\"https://pypi.python.org/pypi/prefect-client/\" alt=\"PyPI version\">\n        <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/prefect-client?color=0052FF&labelColor=090422\"></a>\n    <a href=\"https://github.com/prefecthq/prefect/\" alt=\"Stars\">\n        <img src=\"https://img.shields.io/github/stars/prefecthq/prefect?color=0052FF&labelColor=090422\" /></a>\n    <a href=\"https://pepy.tech/badge/prefect-client/\" alt=\"Downloads\">\n        <img src=\"https://img.shields.io/pypi/dm/prefect-client?color=0052FF&labelColor=090422\" /></a>\n    <a href=\"https://github.com/prefecthq/prefect/pulse\" alt=\"Activity\">\n        <img src=\"https://img.shields.io/github/commit-activity/m/prefecthq/prefect?color=0052FF&labelColor=090422\" /></a>\n    <br>\n    <a href=\"https://prefect.io/slack\" alt=\"Slack\">\n        <img src=\"https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack\" /></a>\n    <a href=\"https://discourse.prefect.io/\" alt=\"Discourse\">\n        <img src=\"https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse\" /></a>\n    <a href=\"https://www.youtube.com/c/PrefectIO/\" alt=\"YouTube\">\n        <img src=\"https://img.shields.io/badge/youtube-watch_videos-red.svg?color=0052FF&labelColor=090422&logo=youtube\" /></a>\n</p>\n\n# prefect-client\n\nThe `prefect-client` package is a minimal-installation of `prefect` which is designed for interacting with Prefect Cloud \nor remote any `prefect` server. It sheds some functionality and dependencies in exchange for a smaller installation size, \nmaking it ideal for use in lightweight or ephemeral environments. These characteristics make it ideal for use in lambdas \nor other resource-constrained environments. \n\n\n## Getting started\n\n`prefect-client` shares the same installation requirements as prefect. To install, make sure you are on Python 3.8 or \nlater and run the following command:\n\n```bash\npip install prefect-client\n```\n\nNext, ensure that your `prefect-client` has access to a remote `prefect` server by exporting the `PREFECT_API_KEY` \n(if using Prefect Cloud) and `PREFECT_API_URL` environment variables. Once those are set, use the package in your code as \nyou would normally use `prefect`! \n\n\nFor example, to remotely trigger a run a deployment:\n\n```python\nfrom prefect.deployments import run_deployment\n\n\ndef my_lambda(event):\n    ...\n    run_deployment(\n        name=\"my-flow/my-deployment\",\n        parameters={\"foo\": \"bar\"},\n        timeout=0,\n    )\n\nmy_lambda({})\n```\n\nTo emit events in an event driven system:\n\n```python\nfrom prefect.events import emit_event\n\n\ndef something_happened():\n    emit_event(\"my-event\", resource={\"prefect.resource.id\": \"foo.bar\"})\n\nsomething_happened()\n```\n\n\nOr just interact with a `prefect` API:\n```python\nfrom prefect.client.orchestration import get_client\n\n\nasync def query_api():\n    async with get_client() as client:\n        limits = await client.read_concurrency_limits(limit=10, offset=0)\n        print(limits)\n\n\nquery_api()\n```\n\n\n## Known limitations\nBy design, `prefect-client` omits all CLI and server components. This means that the CLI is not available for use \nand attempts to access server objects will fail. Furthermore, some classes, methods, and objects may be available \nfor import in `prefect-client` but may not be \"runnable\" if they tap into server-oriented functionality. If you \nencounter such a limitation, feel free to [open an issue](https://github.com/PrefectHQ/prefect/issues/new/choose) \ndescribing the functionality you are interested in using and we will do our best to make it available.\n\n\n## Next steps\n\nThere's lots more you can do to orchestrate and observe your workflows with Prefect!\nStart with our [friendly tutorial](https://docs.prefect.io/tutorials) or explore the [core concepts of Prefect workflows](https://docs.prefect.io/concepts/).\n\n## Join the community\n\nPrefect 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](https://prefect.io/slack) 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](https://discourse.prefect.io/faq).\n\n## Contribute\n\nSee our [documentation on contributing to Prefect](https://docs.prefect.io/contributing/overview/).\n\nThanks for being part of the mission to build a new kind of workflow system and, of course, **happy engineering!**\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Workflow orchestration and management.",
    "version": "2.19.5",
    "project_urls": {
        "Changelog": "https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md",
        "Documentation": "https://docs.prefect.io",
        "Homepage": "https://www.prefect.io",
        "Source": "https://github.com/PrefectHQ/prefect",
        "Tracker": "https://github.com/PrefectHQ/prefect/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "727d00bca8b182ea61fc78e89736121e3fa81e3c718775ae5ab2875e613d20b1",
                "md5": "fa7ac948716405c4cb7a0b270c28b657",
                "sha256": "afaa130a2b578722b71ab78871252109dd3049b789eb8b8f5e2f43265a8ff51f"
            },
            "downloads": -1,
            "filename": "prefect_client-2.19.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa7ac948716405c4cb7a0b270c28b657",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 762408,
            "upload_time": "2024-06-13T18:58:39",
            "upload_time_iso_8601": "2024-06-13T18:58:39.693577Z",
            "url": "https://files.pythonhosted.org/packages/72/7d/00bca8b182ea61fc78e89736121e3fa81e3c718775ae5ab2875e613d20b1/prefect_client-2.19.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21b7aa8caa6aad7ca1e050d95680509f873f890fe149d1557bb6ad48bcf28e37",
                "md5": "e8f384204046331b36c9297017c22c0c",
                "sha256": "bae8ba54b0b2e7f90500394de42b4dd690a21728e08842a0a0609ac88664a877"
            },
            "downloads": -1,
            "filename": "prefect-client-2.19.5.tar.gz",
            "has_sig": false,
            "md5_digest": "e8f384204046331b36c9297017c22c0c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 666743,
            "upload_time": "2024-06-13T18:58:41",
            "upload_time_iso_8601": "2024-06-13T18:58:41.567042Z",
            "url": "https://files.pythonhosted.org/packages/21/b7/aa8caa6aad7ca1e050d95680509f873f890fe149d1557bb6ad48bcf28e37/prefect-client-2.19.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-13 18:58:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PrefectHQ",
    "github_project": "prefect",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "prefect-client"
}
        
Elapsed time: 0.29695s