<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://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 a workflow orchestration framework for building data pipelines in Python.
It's the simplest way to elevate a script into a resilient production workflow.
With Prefect, you can build resilient, dynamic data pipelines that react to the world around them and recover from unexpected changes.
With just a few lines of code, data teams can confidently automate any data process with features such as scheduling, caching, retries, and event-based automations.
Workflow activity is tracked and can be monitored with a self-hosted [Prefect server](https://docs.prefect.io/latest/manage/self-host/?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) 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.9 or later. To [install the latest or upgrade to the latest version of Prefect](https://docs.prefect.io/get-started/install), run the following command:
```bash
pip install -U 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
```
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
if __name__ == "__main__":
github_stars.serve(
name="first-deployment",
cron="* * * * *",
parameters={"repos": ["PrefectHQ/prefect"]}
)
```
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. You can even run deployments in response to [events](https://docs.prefect.io/latest/automate/?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none).
## Prefect Cloud
Prefect Cloud provides workflow orchestration for the modern data enterprise. By automating over 200 million data tasks monthly, Prefect empowers diverse organizations — from Fortune 50 leaders such as Progressive Insurance to innovative disruptors such as Cash App — to increase engineering productivity, reduce pipeline errors, and cut data workflow compute costs.
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-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 is a lighter-weight option for accessing client-side functionality in the Prefect SDK and is ideal for use in ephemeral execution environments.
## Next steps
- Check out the [Docs](https://docs.prefect.io/).
- Join the [Prefect Slack community](https://prefect.io/slack).
- Learn how to [contribute to Prefect](https://docs.prefect.io/contribute/).
Raw data
{
"_id": null,
"home_page": "https://www.prefect.io",
"name": "prefect",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Prefect Technologies, Inc.",
"author_email": "help@prefect.io",
"download_url": "https://files.pythonhosted.org/packages/e5/70/dde05e7d269bdc3a403e1c462e1541b2d80c6738dde2c4dfa6556bf2b9f6/prefect-3.1.9.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://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 a workflow orchestration framework for building data pipelines in Python.\nIt's the simplest way to elevate a script into a resilient production workflow.\nWith Prefect, you can build resilient, dynamic data pipelines that react to the world around them and recover from unexpected changes.\n\nWith just a few lines of code, data teams can confidently automate any data process with features such as scheduling, caching, retries, and event-based automations.\n\nWorkflow activity is tracked and can be monitored with a self-hosted [Prefect server](https://docs.prefect.io/latest/manage/self-host/?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none) 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.9 or later. To [install the latest or upgrade to the latest version of Prefect](https://docs.prefect.io/get-started/install), run the following command:\n\n```bash\npip install -U 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\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\nif __name__ == \"__main__\":\n github_stars.serve(\n name=\"first-deployment\",\n cron=\"* * * * *\",\n parameters={\"repos\": [\"PrefectHQ/prefect\"]}\n )\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. You can even run deployments in response to [events](https://docs.prefect.io/latest/automate/?utm_source=oss&utm_medium=oss&utm_campaign=oss_gh_repo&utm_term=none&utm_content=none).\n\n## Prefect Cloud\n\nPrefect Cloud provides workflow orchestration for the modern data enterprise. By automating over 200 million data tasks monthly, Prefect empowers diverse organizations \u2014 from Fortune 50 leaders such as Progressive Insurance to innovative disruptors such as Cash App \u2014 to increase engineering productivity, reduce pipeline errors, and cut data workflow compute costs.\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-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 is a lighter-weight option for accessing client-side functionality in the Prefect SDK and is ideal for use in ephemeral execution environments.\n\n## Next steps\n\n- Check out the [Docs](https://docs.prefect.io/).\n- Join the [Prefect Slack community](https://prefect.io/slack).\n- Learn how to [contribute to Prefect](https://docs.prefect.io/contribute/).\n",
"bugtrack_url": null,
"license": null,
"summary": "Workflow orchestration and management.",
"version": "3.1.9",
"project_urls": {
"Changelog": "https://github.com/PrefectHQ/prefect/releases",
"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": "8c98673787e233217487f6cec472128f3a6cf9f8873335a4d031931469a110b3",
"md5": "b03da2ba558bac72b6a0ed991c3a9531",
"sha256": "39b094c3688d9ba1672d6c61aa2896b6a9b463cf64f97be435665dd3b4538098"
},
"downloads": -1,
"filename": "prefect-3.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b03da2ba558bac72b6a0ed991c3a9531",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6197076,
"upload_time": "2024-12-20T21:54:41",
"upload_time_iso_8601": "2024-12-20T21:54:41.476828Z",
"url": "https://files.pythonhosted.org/packages/8c/98/673787e233217487f6cec472128f3a6cf9f8873335a4d031931469a110b3/prefect-3.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e570dde05e7d269bdc3a403e1c462e1541b2d80c6738dde2c4dfa6556bf2b9f6",
"md5": "7a17f37040d2a3265924a9c75195f241",
"sha256": "43c672d7f74d2a09a228e5d0cacf7bbfb42f5fa99970beaf1e0bd1e543580829"
},
"downloads": -1,
"filename": "prefect-3.1.9.tar.gz",
"has_sig": false,
"md5_digest": "7a17f37040d2a3265924a9c75195f241",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 5912899,
"upload_time": "2024-12-20T21:54:45",
"upload_time_iso_8601": "2024-12-20T21:54:45.918424Z",
"url": "https://files.pythonhosted.org/packages/e5/70/dde05e7d269bdc3a403e1c462e1541b2d80c6738dde2c4dfa6556bf2b9f6/prefect-3.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 21:54:45",
"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"
}