prefect


Nameprefect JSON
Version 2.18.3 PyPI version JSON
download
home_pagehttps://www.prefect.io
SummaryWorkflow orchestration and management.
upload_time2024-05-02 22:53:31
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/" alt="PyPI version">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect?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/" alt="Downloads">
        <img src="https://img.shields.io/pypi/dm/prefect?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

Prefect is an orchestration and observability platform for building, observing, and triaging workflows. 
It's the simplest way to transform Python code into an interactive workflow application.

Prefect allows you to expose your workflows through an API so teams dependent on you can programmatically access your pipelines, business logic, and more.
Prefect also allows you to standardize workflow development and deployment across your organization.

With Prefect, you can build resilient, dynamic workflows that react to the world around them and recover from unexpected changes.
With just a few decorators, Prefect supercharges your code with features like automatic retries, distributed execution, scheduling, caching, and much more.

Every activity is tracked and can be monitored with a self-hosted [Prefect server](https://docs.prefect.io/latest/guides/host/) instance or managed [Prefect Cloud](https://www.prefect.io/cloud-vs-oss?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) dashboard.

## Getting started

Prefect requires Python 3.8 or later. To [install Prefect](https://docs.prefect.io/getting-started/installation/), run the following command:

```bash
pip install prefect
```

Then create and run a Python file that uses Prefect `flow` and `task` decorators to orchestrate and observe your workflow - in this case, a simple script that fetches the number of GitHub stars from a repository:

```python
from prefect import flow, task
from typing import List
import httpx


@task(log_prints=True)
def get_stars(repo: str):
    url = f"https://api.github.com/repos/{repo}"
    count = httpx.get(url).json()["stargazers_count"]
    print(f"{repo} has {count} stars!")


@flow(name="GitHub Stars")
def github_stars(repos: List[str]):
    for repo in repos:
        get_stars(repo)


# run the flow!
if __name__=="__main__":
    github_stars(["PrefectHQ/Prefect"])
```

Fire up the Prefect UI to see what happened:

```bash
prefect server start
```

![Prefect UI dashboard](/docs/img/ui/cloud-dashboard.png)

To run your workflow on a schedule, turn it into a deployment and schedule it to run every minute by changing the last line of your script to the following:

```python
    github_stars.serve(name="first-deployment", cron="* * * * *")
```

You now have a server running locally that is looking for scheduled deployments!
Additionally you can run your workflow manually from the UI or CLI - and if you're using Prefect Cloud, you can even run deployments in response to [events](https://docs.prefect.io/latest/concepts/automations/).

## Prefect Cloud

Stop worrying about your workflows.
Prefect Cloud allows you to centrally deploy, monitor, and manage the data workflows you support. With managed orchestration, automations, and webhooks, all backed by enterprise-class security, build production-ready code quickly and reliably.

Read more about Prefect Cloud [here](https://www.prefect.io/cloud-vs-oss?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) or sign up to [try it for yourself](https://app.prefect.cloud?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none).

![Prefect Automations](/docs/img/ui/automations.png)

## prefect-client

If your use case is geared towards communicating with Prefect Cloud or a remote Prefect server, check out our 
[prefect-client](https://pypi.org/project/prefect-client/). It was designed to be a lighter-weight option for accessing 
client-side functionality in the Prefect SDK and is ideal for use in ephemeral execution environments.

## 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",
    "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/d0/38/7e78757e840e9c9fbd642dad4e8152e4a9b760813906828066fd9da8581e/prefect-2.18.3.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/\" alt=\"PyPI version\">\n        <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/prefect?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/\" alt=\"Downloads\">\n        <img src=\"https://img.shields.io/pypi/dm/prefect?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\n\nPrefect is an orchestration and observability platform for building, observing, and triaging workflows. \nIt's the simplest way to transform Python code into an interactive workflow application.\n\nPrefect allows you to expose your workflows through an API so teams dependent on you can programmatically access your pipelines, business logic, and more.\nPrefect also allows you to standardize workflow development and deployment across your organization.\n\nWith Prefect, you can build resilient, dynamic workflows that react to the world around them and recover from unexpected changes.\nWith just a few decorators, Prefect supercharges your code with features like automatic retries, distributed execution, scheduling, caching, and much more.\n\nEvery activity is tracked and can be monitored with a self-hosted [Prefect server](https://docs.prefect.io/latest/guides/host/) instance or managed [Prefect Cloud](https://www.prefect.io/cloud-vs-oss?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) dashboard.\n\n## Getting started\n\nPrefect requires Python 3.8 or later. To [install Prefect](https://docs.prefect.io/getting-started/installation/), run the following command:\n\n```bash\npip install prefect\n```\n\nThen create and run a Python file that uses Prefect `flow` and `task` decorators to orchestrate and observe your workflow - in this case, a simple script that fetches the number of GitHub stars from a repository:\n\n```python\nfrom prefect import flow, task\nfrom typing import List\nimport httpx\n\n\n@task(log_prints=True)\ndef get_stars(repo: str):\n    url = f\"https://api.github.com/repos/{repo}\"\n    count = httpx.get(url).json()[\"stargazers_count\"]\n    print(f\"{repo} has {count} stars!\")\n\n\n@flow(name=\"GitHub Stars\")\ndef github_stars(repos: List[str]):\n    for repo in repos:\n        get_stars(repo)\n\n\n# run the flow!\nif __name__==\"__main__\":\n    github_stars([\"PrefectHQ/Prefect\"])\n```\n\nFire up the Prefect UI to see what happened:\n\n```bash\nprefect server start\n```\n\n![Prefect UI dashboard](/docs/img/ui/cloud-dashboard.png)\n\nTo run your workflow on a schedule, turn it into a deployment and schedule it to run every minute by changing the last line of your script to the following:\n\n```python\n    github_stars.serve(name=\"first-deployment\", cron=\"* * * * *\")\n```\n\nYou now have a server running locally that is looking for scheduled deployments!\nAdditionally you can run your workflow manually from the UI or CLI - and if you're using Prefect Cloud, you can even run deployments in response to [events](https://docs.prefect.io/latest/concepts/automations/).\n\n## Prefect Cloud\n\nStop worrying about your workflows.\nPrefect Cloud allows you to centrally deploy, monitor, and manage the data workflows you support. With managed orchestration, automations, and webhooks, all backed by enterprise-class security, build production-ready code quickly and reliably.\n\nRead more about Prefect Cloud [here](https://www.prefect.io/cloud-vs-oss?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) or sign up to [try it for yourself](https://app.prefect.cloud?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none).\n\n![Prefect Automations](/docs/img/ui/automations.png)\n\n## prefect-client\n\nIf your use case is geared towards communicating with Prefect Cloud or a remote Prefect server, check out our \n[prefect-client](https://pypi.org/project/prefect-client/). It was designed to be a lighter-weight option for accessing \nclient-side functionality in the Prefect SDK and is ideal for use in ephemeral execution environments.\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",
    "bugtrack_url": null,
    "license": null,
    "summary": "Workflow orchestration and management.",
    "version": "2.18.3",
    "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": "9653a80c336d0f7ce02efaa2ccbae31dc1b0ee12c1bbc148512780a98979faea",
                "md5": "b7c6ac2432e75d9c4ed4cdecf13e7cc5",
                "sha256": "b77bae58f056e3e6633abdd9a465411c58a0f1d871201fcd4a35388446c1a4ea"
            },
            "downloads": -1,
            "filename": "prefect-2.18.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b7c6ac2432e75d9c4ed4cdecf13e7cc5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5797314,
            "upload_time": "2024-05-02T22:53:27",
            "upload_time_iso_8601": "2024-05-02T22:53:27.089450Z",
            "url": "https://files.pythonhosted.org/packages/96/53/a80c336d0f7ce02efaa2ccbae31dc1b0ee12c1bbc148512780a98979faea/prefect-2.18.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0387e78757e840e9c9fbd642dad4e8152e4a9b760813906828066fd9da8581e",
                "md5": "8eddd452216f7d64e3beba54ac12427a",
                "sha256": "b5c7ce517ca118a1490634c689fb53d19ba1c07ce524d79f9862b23ad1a0bfce"
            },
            "downloads": -1,
            "filename": "prefect-2.18.3.tar.gz",
            "has_sig": false,
            "md5_digest": "8eddd452216f7d64e3beba54ac12427a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5501138,
            "upload_time": "2024-05-02T22:53:31",
            "upload_time_iso_8601": "2024-05-02T22:53:31.257749Z",
            "url": "https://files.pythonhosted.org/packages/d0/38/7e78757e840e9c9fbd642dad4e8152e4a9b760813906828066fd9da8581e/prefect-2.18.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 22:53:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PrefectHQ",
    "github_project": "prefect",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "requirements": [],
    "lcname": "prefect"
}
        
Elapsed time: 0.58256s