• Stars
    star
    14,421
  • Rank 1,960 (Top 0.04 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated 25 days 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 tool empowering developers to build, observe, and react to data pipelines

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
4,607
star
2

prefect-recipes

Snippets and templates representing common Customer Success patterns
HCL
214
star
3

server

The Prefect API and backend
Python
211
star
4

ui

The home of the Prefect 1 UI
Vue
177
star
5

langchain-prefect

Tools for using Langchain with Prefect
Python
92
star
6

prefect-aws

Prefect integrations with AWS.
Python
87
star
7

prefect-helm

Helm charts for deploying Prefect Services
Smarty
80
star
8

prefect-dbt

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

prefect-collection-template

Template to quickly bootstrap a Prefect Collection
Python
64
star
10

prefect-dask

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

prefect-gcp

Prefect integrations with Google Cloud Platform.
Python
49
star
12

prefect-ray

Prefect integrations with Ray
Python
48
star
13

prefect-shell

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

prefect-kubernetes

Prefect integrations for interacting with Kubernetes.
Python
45
star
15

prefect-databricks

Prefect integrations for interacting with Databricks.
Python
39
star
16

prefect-azure

Prefect integrations with Microsoft Azure
Python
35
star
17

prefect-airbyte

Python
34
star
18

prefect-snowflake

Prefect integrations for orchestrating Snowflake.
Python
34
star
19

prefect-email

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

prefect-openmetadata

Prefect integration with OpenMetadata
Python
31
star
21

prefect-openai

Prefect integrations for working with OpenAI.
Python
31
star
22

prefect-github

Prefect integrations for interacting with GitHub
Python
29
star
23

prefect-twitter

Prefect integrations for interacting with Twitter.
Python
26
star
24

prefect-docker

Prefect integrations for working with Docker
Python
26
star
25

prefect-postgres

Prefect integrations for interacting with postgres.
Python
24
star
26

prefect-great-expectations

Prefect integrations for interacting with Great Expectations
Python
24
star
27

prefect-design

Vue
23
star
28

prefect-twilio

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

prefect-sendgrid

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

prefect-sqlalchemy

Prefect integrations with SQLAlchemy.
Python
20
star
31

prefect-slack

Prefect integrations with Slack
Python
18
star
32

prefect-jupyter

Prefect integrations interacting with Jupyter.
Python
16
star
33

miter-design

Miter Design component library made with ♡ by Prefect
SCSS
14
star
34

prefect-monte-carlo

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

prefect-monday

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

prefect-gitlab

A Prefect collection for working with GitLab repositories.
Python
13
star
37

prefect-binder-tutorial

Jupyter Notebook
12
star
38

prefect-ui-library

Vue and Typescript library for Prefect 2 and Prefect Cloud 2
Vue
12
star
39

prefect-intel

Prefect / Intel collaboration
Python
12
star
40

prefect-hightouch

Prefect integrations for interacting with Hightouch.
Python
11
star
41

terraform-provider-prefect

Go
11
star
42

marvin-recipes

applications of https://github.com/PrefectHQ/marvin
Python
10
star
43

actions-prefect-deploy

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

prefect-hex

Prefect integrations for interacting with Hex.
Python
9
star
45

memory-graphql

Frontend Developer Coding Challenge
JavaScript
9
star
46

vue-compositions

A collection of reusable vue compositions
TypeScript
7
star
47

prefect-bitbucket

Prefect integrations for working with Bitbucket repositories
Python
7
star
48

prefect-background-task-examples

Examples of using Prefect for background tasks in web applications
Python
7
star
49

prefect-collection-registry

Source of truth for collection contents across the Prefect ecosystem
Python
6
star
50

memory

Junior Frontend Developer Coding Challenge
JavaScript
5
star
51

sample_flows

Prefect's example Flows
Python
5
star
52

graphs

Large scale graphs designed for Prefect
TypeScript
5
star
53

prefect-census

Prefect integrations for working with Census syncs
Python
5
star
54

prefect-firebolt

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

prefect-demos

Sales Engineering demo repository
Python
4
star
56

premojis

Emojis for Prefect
4
star
57

prometheus-prefect-exporter

Prometheus Prefect Exporter
Python
3
star
58

vue-charts

Vue
3
star
59

legacy-api-docs

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

hello-projects

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

prefect-demo-stocks

Python
2
star
62

test_flows

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

eslint-config

JavaScript
1
star
64

actions-prefect-auth

A GitHub Action for authenticating into Prefect Cloud
1
star
65

GitHub-Issue-Autoresponder

Python
1
star
66

qa-wolf-flows

Flows used by QA Wolf for testing
Python
1
star
67

prefect-runner-top-secret

Prefect is a workflow orchestration tool empowering developers to build, observe, and react to data pipelines
Python
1
star