Skip to main content

An extension to add Prefect flow visualizations into you Sphinx documentation.

Project description

[Latest PyPI version] [Supported Python versions] [Code style: black]

An extension to add Prefect flow visualizations into you Sphinx documentation.

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

Use the following directive to add a flow visualization into your documentation.

.. flowviz:: module.submodule.flow

Long story

First of all, make sure that your prefect flow(s) can be imported by your Sphinx project.

In our case, we have to comment-in the following LOC in the top of conf.py:

import os
import sys
sys.path.insert(0, os.path.abspath('.'))

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

@task
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.2.0.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

sphinxcontrib_prefectviz-0.2.0-py3-none-any.whl (6.0 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