Skip to main content

Use docstring to annotate pipen processes

Project description

pipen-annotate

Use docstring to annotate pipen processes

Installation

pip install pipen-annotate

Usage

from pipen import Proc
from pipen_annotate import annotate

@annotate
class Process(Proc):
    """Short description

    Long description

    Input:
        infile: An input file
        invar: An input variable

    Output:
        outfile: The output file

    Args:
        ncores: Number of cores
    """
    input = "infile:file, invar"
    output = "outfile:file:output.txt"
    args = {'ncores': 1}

print(Process.annotated)
# prints:
{'args': {'ncores': ParsedItem(name='ncores',
                               type=None,
                               desc='Number of cores',
                               more=[ParsedPara(lines=['Default: 1'])])},
 'input': {'infile': ParsedItem(name='infile',
                                type='file',
                                desc='An input file',
                                more=[]),
           'invar': ParsedItem(name='invar',
                               type='var',
                               desc='An input variable',
                               more=[])},
 'long': [ParsedPara(lines=['Long description'])],
 'output': {'outfile': ParsedItem(name='outfile',
                                  type='file',
                                  desc='The output file',
                                  more=[ParsedPara(lines=['Default: output.txt'])])},
 'short': ParsedPara(lines=['Short description'])}

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

pipen_annotate-0.0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

pipen_annotate-0.0.3-py3-none-any.whl (3.2 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