An extension to add Prefect flow visualizations into you Sphinx documentation.
Project description
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
Links
Project details
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
Built Distribution
File details
Details for the file sphinxcontrib-prefectviz-0.2.0.tar.gz
.
File metadata
- Download URL: sphinxcontrib-prefectviz-0.2.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 008179c6105ed587fbe3716637c2c39071793b1dcfd7a5f84760039b0a970e58 |
|
MD5 | 51e96583f21dff4340b891b57ca07314 |
|
BLAKE2b-256 | fc856e007f2e42f2b0146fdd1533660c85d1c07649609b991d88041e0462f3c2 |
File details
Details for the file sphinxcontrib_prefectviz-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: sphinxcontrib_prefectviz-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8388bf24bb0f6d185f183024071f0e3ce677ff1e7fa03a09da92540f422cd7f |
|
MD5 | 9caf3955986868cfd7089e61b3de62ba |
|
BLAKE2b-256 | cd28169d45aae4e99372c63221fecc0375a9741122d3fcc1d831aca83ba9b353 |