Skip to main content

Use docstring to annotate pipen processes

Project description

pipen-annotate

Use docstring to annotate pipen processes

Installation

pip install -U pipen-annotate

Usage

from pprint import pprint
from pipen import Proc
from pipen_annotate import annotate


class Process(Proc):
    """Short description

    Long description

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

    Output:
        outfile: The output file

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

annotated = annotate(Process)
# prints:
{'Envs': {'ncores': {'attrs': OrderedDiot([('default', 1)]),
                     'help': 'Number of cores',
                     'terms': OrderedDiot([])}},
 'Input': {'infile': {'attrs': {'action': 'extend',
                                'itype': 'file',
                                'nargs': '+'},
                      'help': 'An input file',
                      'terms': OrderedDiot([])},
           'invar': {'attrs': {'action': 'extend',
                               'itype': 'var',
                               'nargs': '+'},
                     'help': 'An input variable',
                     'terms': OrderedDiot([])}},
 'Output': {'outfile': {'attrs': {'default': 'output.txt',
                                  'otype': 'file'},
                        'help': 'The output file',
                        'terms': OrderedDiot([])}},
 'Summary': {'long': 'Long description\n',
             'short': '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.5.4.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

pipen_annotate-0.5.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file pipen_annotate-0.5.4.tar.gz.

File metadata

  • Download URL: pipen_annotate-0.5.4.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.15.0-1034-azure

File hashes

Hashes for pipen_annotate-0.5.4.tar.gz
Algorithm Hash digest
SHA256 a3a201f2e6467b67fc2afcfb42aa0676db36a68fc2b9470d72ffcb45bafaa6d1
MD5 a48165953fb307a69719df1050d4486f
BLAKE2b-256 38600500a9746106f4644dab9764aafec5c7f1e1310d0c5491c4ea5c6a1d3100

See more details on using hashes here.

File details

Details for the file pipen_annotate-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: pipen_annotate-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.15.0-1034-azure

File hashes

Hashes for pipen_annotate-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b1b1526764faa8107c92775d1e8a047692d94c237ab6c470d15362e6e48ed507
MD5 2999569840990b8465726b3b1d0bf6cf
BLAKE2b-256 db625f0034f9d650ef28ae083e7e3ffca426f7a7657393a8a061af11e4b8f722

See more details on using hashes here.

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