Skip to main content

Prefect collection of tasks and subflows to integrate with AWS

Project description

prefect-aws

PyPI

Welcome!

prefect-aws is a collection of pre-built Prefect tasks that can be used to quickly construct Prefect flows that interact with Amazon Web Services.

Getting Started

Python setup

Requires an installation of Python 3.7+

We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.

These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the Prefect documentation.

Installation

Install prefect-aws

pip install prefect-aws

A list of available blocks in prefect-aws and their setup instructions can be found here.

AWS Authentication

You will need to obtain AWS credentials in order to use these tasks. Refer to the AWS documentation for authentication methods available.

Write and run a flow

Upload and download from S3Bucket

from prefect import flow
from prefect_aws.s3 import S3Bucket

@flow
def example_flow():
    with open("hello.py", "w") as f:
        f.write("print('Hello world!')")

    s3_bucket = S3Bucket.load("my-bucket-test")
    s3_bucket.upload_from_path("hello.py")
    s3_bucket.download_object_to_path("hello.py", "downloaded_hello.py")

example_flow()

Use with_options to customize options on any existing task or flow

custom_example_flow = example_flow.with_options(
    name="My custom task name",
    retries=2,
    retry_delay_seconds=10,
) 

Next steps

Refer to the API documentation in the side menu to explore all the capabilities of Prefect AWS!

For more tips on how to use tasks and flows in a Collection, check out Using Collections!

Resources

If you have any questions or issues while using prefect-aws, you can find help in either the Prefect Discourse forum or the Prefect Slack community.

Feel free to star or watch prefect-aws for updates too!

Contribute

If you'd like to help contribute to fix an issue or add a feature to prefect-aws, please propose changes through a pull request from a fork of the repository.

Contribution Steps:

  1. Fork the repository
  2. Clone the forked repository
  3. Install the repository and its dependencies:
pip install -e ".[dev]"
  1. Make desired changes.
  2. Add tests.
  3. Insert an entry to CHANGELOG.md
  4. Install pre-commit to perform quality checks prior to commit:
pre-commit install
  1. git commit, git push, and create a pull request.

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-aws-0.2.3.tar.gz (52.3 kB view hashes)

Uploaded Source

Built Distribution

prefect_aws-0.2.3-py3-none-any.whl (37.1 kB view hashes)

Uploaded Python 3

Supported by

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