Skip to main content

Flyte SDK for Python

Project description

Flytekit

PyPI version fury.io PyPI download day PyPI download month PyPI format PyPI implementation Codecov PyPI pyversions Docs

Python Library for easily authoring, testing, deploying, and interacting with Flyte tasks, workflows, and launch plans. To understand more about flyte refer to,

Installation

Flytekit is the core extensible library to author Flyte workflows and tasks and interact with Flyte Backend services. Flyte plugins can be installed separately.

Base Installation

pip install flytekit==0.16.0b6

Simple getting started

from flytekit import task, workflow

@task(cache=True, cache_version="1", retries=3)
def sum(x: int, y: int) -> int:
    return x + y

@task(cache=True, cache_version="1", retries=3)
def square(x: int) -> int:
    return x*x

@workflow
def my_workflow(x: int, y: int) -> int:
    return sum(x=square(x=x),y=square(y=y))

Learn Flytekit by example using

Plugins:

Refer to plugins/README.md for a list of available plugins. There may be plugins outside of this list, but this list is maintained by the core maintainers.

Development

Guide to contribute and develop flytekit

Recipes

$ make
Available recipes:
  setup        Install requirements
  fmt          Format code with black and isort
  lint         Run linters
  test         Run tests
  requirements Compile requirements

Setup (Do Once)

virtualenv ~/.virtualenvs/flytekit
source ~/.virtualenvs/flytekit/bin/activate
make setup

Formatting

We use black and isort to autoformat code. Run the following command to execute the formatters:

source ~/.virtualenvs/flytekit/bin/activate
make fmt

Testing

Unit Testing

source ~/.virtualenvs/flytekit/bin/activate
make test

Updating requirements

Update requirements in requirements.in (or requirements-spark3.in), or update requirements for development in dev-requirements.in. Then, validate, pin and freeze all requirements by running:

source ~/.virtualenvs/flytekit/bin/activate
make requirements

This will re-create the requirements.txt (or requirements-spark3.in) and dev-requirements.txt files which will be used for testing. You will have also have to re-run make setup to update your local environment with the updated requirements.

Release history Release notifications | RSS feed

Download files

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

Source Distribution

flytekit-0.16.0b7.tar.gz (309.2 kB view hashes)

Uploaded Source

Built Distribution

flytekit-0.16.0b7-py3-none-any.whl (400.3 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