• Stars
    star
    16,121
  • Rank 1,774 (Top 0.04 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.

PyPI

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 instance or managed Prefect Cloud dashboard.

Getting started

Prefect requires Python 3.8 or later. To install Prefect, run the following command:

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:

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:

prefect server start

Prefect UI dashboard

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:

    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.

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 or sign up to try it for yourself.

Prefect Automations

prefect-client

If your use case is geared towards communicating with Prefect Cloud or a remote Prefect server, check out our 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 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!

More Repositories

1

marvin

✨ Build AI interfaces that spark joy
Python
5,146
star
2

ControlFlow

🦾 Take control of your AI agents
Python
676
star
3

prefect-recipes

Snippets and templates representing common Customer Success patterns
HCL
238
star
4

server

The Prefect API and backend
Python
211
star
5

ui

The home of the Prefect 1 UI
Vue
177
star
6

langchain-prefect

Tools for using Langchain with Prefect
Python
99
star
7

prefect-aws

Prefect integrations with AWS.
Python
84
star
8

prefect-helm

Helm charts for deploying Prefect Services
Smarty
80
star
9

prefect-dbt

Collection of Prefect integrations for working with dbt with your Prefect flows.
Python
70
star
10

prefect-collection-template

Template to quickly bootstrap a Prefect Collection
Python
65
star
11

prefect-dask

Prefect integrations with the Dask execution framework.
Python
54
star
12

prefect-kubernetes

Prefect integrations for interacting with Kubernetes.
Python
50
star
13

prefect-gcp

Prefect integrations with Google Cloud Platform.
Python
49
star
14

prefect-ray

Prefect integrations with Ray
Python
48
star
15

prefect-shell

Prefect tasks and subflows for interacting with shell commands.
Python
46
star
16

prefect-databricks

Prefect integrations for interacting with Databricks.
Python
39
star
17

prefect-azure

Prefect integrations with Microsoft Azure
Python
35
star
18

prefect-airbyte

Python
34
star
19

prefect-snowflake

Prefect integrations for orchestrating Snowflake.
Python
34
star
20

prefect-email

Prefect tasks and subflows for interacting with email
Python
33
star
21

prefect-openmetadata

Prefect integration with OpenMetadata
Python
31
star
22

prefect-openai

Prefect integrations for working with OpenAI.
Python
31
star
23

prefect-design

Vue
29
star
24

prefect-github

Prefect integrations for interacting with GitHub
Python
29
star
25

prefect-twitter

Prefect integrations for interacting with Twitter.
Python
26
star
26

prefect-docker

Prefect integrations for working with Docker
Python
26
star
27

prefect-postgres

Prefect integrations for interacting with postgres.
Python
24
star
28

prefect-great-expectations

Prefect integrations for interacting with Great Expectations
Python
24
star
29

prefect-twilio

Prefect tasks and subflows for interacting with Twilio.
Python
22
star
30

prefect-sendgrid

Prefect tasks and subflows for interacting with SendGrid.
Python
22
star
31

prefect-ui-library

Vue and Typescript library for Prefect 2 and Prefect Cloud 2
TypeScript
20
star
32

prefect-sqlalchemy

Prefect integrations with SQLAlchemy.
Python
20
star
33

prefect-slack

Prefect integrations with Slack
Python
18
star
34

prefect-jupyter

Prefect integrations interacting with Jupyter.
Python
16
star
35

prefect-background-task-examples

Examples of using Prefect for background tasks in web applications
Python
16
star
36

prefect-monte-carlo

A collection of Prefect tasks and flows to orchestrate Monte Carlo.
Python
14
star
37

miter-design

Miter Design component library made with ♡ by Prefect
SCSS
13
star
38

prefect-monday

Prefect integrations for interacting with monday.com
Python
13
star
39

prefect-binder-tutorial

Jupyter Notebook
12
star
40

marvin-recipes

applications of https://github.com/PrefectHQ/marvin
Python
12
star
41

prefect-gitlab

A Prefect collection for working with GitLab repositories.
Python
12
star
42

prefect-intel

Prefect / Intel collaboration
Python
12
star
43

prefect-hightouch

Prefect integrations for interacting with Hightouch.
Python
11
star
44

terraform-provider-prefect

Go
11
star
45

prefect-operator

A Kubernetes operator for managing Prefect servers and work pools
Go
9
star
46

actions-prefect-deploy

A GitHub Action for deploying a Prefect flow to Prefect Cloud
9
star
47

prefect-hex

Prefect integrations for interacting with Hex.
Python
9
star
48

memory-graphql

Frontend Developer Coding Challenge
JavaScript
9
star
49

vue-compositions

A collection of reusable vue compositions
TypeScript
8
star
50

graphs

Large scale graphs designed for Prefect
TypeScript
8
star
51

prefect-collection-registry

Source of truth for collection contents across the Prefect ecosystem
Python
8
star
52

prefect-bitbucket

Prefect integrations for working with Bitbucket repositories
Python
7
star
53

prefect-demos

Sales Engineering demo repository
Python
6
star
54

memory

Junior Frontend Developer Coding Challenge
JavaScript
5
star
55

sample_flows

Prefect's example Flows
Python
5
star
56

prefect-firebolt

Prefect integrations for working with Firebolt data warehouses.
Python
5
star
57

prefect-census

Prefect integrations for working with Census syncs
Python
5
star
58

prefect-duckdb

Python
4
star
59

premojis

Emojis for Prefect
4
star
60

vue-charts

Vue
4
star
61

prometheus-prefect-exporter

Prometheus Prefect Exporter
Python
3
star
62

legacy-api-docs

Legacy API documentation for https://github.com/PrefectHQ/prefect
HTML
3
star
63

hello-projects

A repository used for demo'ing Prefect projects
Python
2
star
64

prefect-demo-stocks

Python
2
star
65

docs

HTML
2
star
66

eslint-config

JavaScript
1
star
67

GitHub-Issue-Autoresponder

Python
1
star
68

test_flows

A repo of MRE and test work flows
Python
1
star
69

actions-prefect-auth

A GitHub Action for authenticating into Prefect Cloud
1
star
70

documentation

Documentation for Prefect.io v3
MDX
1
star
71

qa-wolf-flows

Flows used by QA Wolf for testing
Python
1
star