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.8.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

pipen_annotate-0.8.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_annotate-0.8.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-1038-azure

File hashes

Hashes for pipen_annotate-0.8.0.tar.gz
Algorithm Hash digest
SHA256 cdd5ded871f86a39172763d77657790d60c76c9f17003ae14d739f5f0da10a01
MD5 7eed98295fad5c26ebbc7a00728e3a9c
BLAKE2b-256 a0b4f35a2549ae6c51614a166db164aa05c19ab52efa2a90d52c532f218f09b4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pipen_annotate-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e93c482e101378fdd42a1d3ce249144acd4122385df9a8f8b9648a049ddb5a3a
MD5 1fa912847251f7d4e4ce17fd6839cb8e
BLAKE2b-256 2d8f0b03cc3340f1b41f4c65f37810b9ea4d0211bf2a9df7d5f2117fa15598d6

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