Metadata-Version: 2.1
Name: prefect-fugue
Version: 0.0.1
Summary: Fugue Prefect integration
Home-page: https://github.com/fugue-project/prefect-fugue
Author: The Fugue Development Team
Author-email: hello@fugue.ai
License: Apache License 2.0
Keywords: prefect
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: prefect (>=2.0.1)
Requires-Dist: fugue (>=0.7.1)
Provides-Extra: dev
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: black ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Dist: mkdocs ; extra == 'dev'
Requires-Dist: mkdocs-material ; extra == 'dev'
Requires-Dist: mkdocstrings[python] ; extra == 'dev'
Requires-Dist: isort ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: pytest-asyncio ; extra == 'dev'
Requires-Dist: pytest-mock ; extra == 'dev'
Requires-Dist: mkdocs-gen-files ; extra == 'dev'
Requires-Dist: interrogate ; extra == 'dev'
Requires-Dist: coverage ; extra == 'dev'
Requires-Dist: fugue[dask,duckdb] ; extra == 'dev'
Requires-Dist: fugue-jupyter ; extra == 'dev'
Requires-Dist: mock ; (python_version < "3.8") and extra == 'dev'

# Prefect Fugue Integration

[![GitHub release](https://img.shields.io/github/release/fugue-project/prefect-fugue.svg)](https://GitHub.com/fugue-project/prefect-fugue)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/prefect-fugue.svg)](https://pypi.python.org/pypi/prefect-fugue/)
[![PyPI license](https://img.shields.io/pypi/l/prefect-fugue.svg)](https://pypi.python.org/pypi/prefect-fugue/)
[![PyPI version](https://badge.fury.io/py/prefect-fugue.svg)](https://pypi.python.org/pypi/prefect-fugue/)
[![codecov](https://codecov.io/gh/fugue-project/prefect-fugue/branch/master/graph/badge.svg?token=J4UB06GWO1)](https://codecov.io/gh/fugue-project/prefect-fugue)
[![Doc](https://readthedocs.org/projects/prefect-fugue/badge)](https://prefect-fugue.readthedocs.org)

[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](http://slack.fugue.ai)


This project provides the Fugue tasks, context and blocks for Prefect.

## 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](https://orion-docs.prefect.io/).

### Installation

Install `prefect-fugue` with `pip`:

```bash
pip install prefect-fugue
```

It's also recommended to register Fugue blocks into your current Prefect workspace:

```bash
prefect block register -m prefect_fugue
```

### Hello World

```python
from prefect import flow
from prefect_fugue import fugue_engine, fsql


@flow
def hello_flow():
    fsql("""
    CREATE [[0]] SCHEMA a:int
    PRINT
    """)

hello_flow()


@flow
def world_flow(n, engine):
    with fugue_engine(engine):
        fsql("""
        CREATE [[0],[1]] SCHEMA a:int
        SELECT * WHERE a>0
        PRINT
        """, n=n)

world_flow(1, "duckdb")  # running using duckdb (assuming duckdb is installed)
world_flow(2, "fugue/my_databricks")  # running using my_databricks block on Prefect
```

## Resources

If you encounter any bugs while using `prefect-fugue`, feel free to open an issue in the [prefect-fugue](https://github.com/fugue-project/prefect-fugue) repository.

If you have any questions or issues while using `prefect-fugue`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).

## Development

If you'd like to install a version of `prefect-fugue` for development, clone the repository and perform an editable install with `pip`:

```bash
git clone https://github.com/fugue-project/prefect-fugue.git

cd prefect-fugue/

pip install -e ".[dev]"

# Install linting pre-commit hooks
pre-commit install
```
