Skip to main content

A Sphinx extension to add Prefect flow visualizations.

Project description

https://travis-ci.org/sphinx-contrib/sphinxcontrib-prefectviz.svg?branch=master

A Sphinx extension to add Prefect flow visualizations.

Overview

This Sphinx extension allows you to add your prefect flow visualization into your Sphinx documentation using a single directive.

Installation

The best way to install this extension is to install it via PyPi:

pip install sphinxcontrib-prefectviz

Configuration

Add 'sphinxcontrib.prefectviz' to the extensions list in conf.py.

extensions = [ 'sphinxcontrib.prefectviz' ]

Usage

Long story short:

.. flowviz:: module.submodule.flow

An example:

First of all, you have to make sure that your prefect flow(s) can be imported by your Sphinx project. Let’s start with the following example, our prefect flow is in the same directory with the Sphinx project:

docs
├── _build
├── conf.py
├── index.rst
├── make.bat
├── Makefile
├── _static
├── _templates
└── flow.py

and the flow.py looks like:

from prefect import task, Flow

@tast
def hello_world():
    print("Hello world")

with Flow(name="foo") as flow:
    hello_world()

Finally, add the flow visualization using the following directive:

.. flowviz:: flow.flow

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

sphinxcontrib-prefectviz-0.1.1.dev2.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

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