Skip to main content

Package for easily deploying to Prefect Cloud.

Project description

prefect-cloud

:zap: Deploy your code to Prefect Cloud in seconds! :zap:

Deploy and run your Python functions on Prefect Cloud with a single command.

Installation

First, install uv if you haven't already. See installation docs here

curl -LsSf https://astral.sh/uv/install.sh | sh

Create and activate a virtual environment:

uv venv && source .venv/bin/activate

Then install prefect-cloud:

uv pip install prefect-cloud

Alternatively, you can run prefect-cloud as a tool without installing it using uvx. See uv tools guide for more details.

Quick Start with uvx (no installation required)

If you prefer to run without installing, you can use uvx to run prefect-cloud commands directly:

# Login to Prefect Cloud
uvx prefect-cloud login

# Connect to GitHub (for private repos)
uvx prefect-cloud github setup

# Deploy your workflow
uvx prefect-cloud deploy examples/hello.py:hello_world --from PrefectHQ/prefect-cloud

# Run it
uvx prefect-cloud run hello_world/hello_world

# Schedule it
uvx prefect-cloud schedule hello_world/hello_world "0 * * * *"

Login to Prefect Cloud

prefect-cloud login

Deploy your workflow

Deploy any Python function from a GitHub repository. For example:

# https://github.com/ExampleOwner/example-repo-cloud/blob/main/examples/hello.py

def hello_world():
    print("Hello, World!")

Deploy to Prefect Cloud

prefect-cloud deploy <path/to/file.py:function_name> --from <source repo URL>

e.g.

prefect-cloud deploy examples/hello.py:hello_world --from PrefectHQ/prefect-cloud

Run it with

prefect-cloud run <flow_name>/<deployment_name>

e.g.

prefect-cloud run hello_world/hello_world

Schedule it with

prefect-cloud schedule <flow_name>/<deployment_name> <SCHEDULE>

e.g.

prefect-cloud schedule hello_world/hello_world "0 * * * *"

Additional Options

Add Dependencies

# Add dependencies
prefect-cloud deploy ... --with pandas --with numpy

# Or install from requirements file at runtime
prefect-cloud deploy ... --with-requirements </path/to/requirements.txt>

Include Environment Variables

prefect-cloud deploy ... --env KEY=VALUE --env KEY2=VALUE2

Include Secrets as Environment Variables

# Create or replace secrets with actual values
prefect-cloud deploy ... --secret API_KEY=actual-secret-value --secret DB_PASSWORD=another-secret-value

# Reference existing secret blocks
prefect-cloud deploy ... --secret API_KEY="{existing-api-key-block}" --secret DB_PASSWORD="{my-database-password}"

From a Private Repository

(Recommended!) Install the Prefect Cloud GitHub App into the repository you want to deploy from. This will allow you to deploy from private repositories without needing to provide a personal access token.

prefect-cloud github setup

Alternatively, you can provide a personal access token on each deploy:

prefect-cloud deploy ... --from <private source repo URL> --credentials GITHUB_TOKEN

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prefect_cloud-0.1.10.tar.gz (134.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prefect_cloud-0.1.10-py3-none-any.whl (56.9 kB view details)

Uploaded Python 3

File details

Details for the file prefect_cloud-0.1.10.tar.gz.

File metadata

  • Download URL: prefect_cloud-0.1.10.tar.gz
  • Upload date:
  • Size: 134.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for prefect_cloud-0.1.10.tar.gz
Algorithm Hash digest
SHA256 1102177dc001e0c01d3328049c91a87b2957c3d346c2b3a3a21b81d4858dc554
MD5 7b89f071ddfa9f8592d353b861de47cb
BLAKE2b-256 643d48a3ec47d54191f5ad5217aea9cf28d5de6cb7a2ea881e952968324132db

See more details on using hashes here.

File details

Details for the file prefect_cloud-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: prefect_cloud-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 56.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for prefect_cloud-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 47d660102e341493db65acd5de2b276a5fc235bb916f1de2c22e7c57d7275f9b
MD5 39fbb191a389c1b45c9ead81f3a1869a
BLAKE2b-256 673b36037d5400014642eb40dccfa2b3158b368964caaf60e108e101b2f398e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page