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

Uploaded Source

Built Distribution

pipen_annotate-0.14.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_annotate-0.14.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1023-azure

File hashes

Hashes for pipen_annotate-0.14.0.tar.gz
Algorithm Hash digest
SHA256 752ce43f3af009ad17fadd109dfc3a87537e119e1ea9352cbf55a16404f88935
MD5 c3b1eb6fb3abf8f70b33ccbb55db5f01
BLAKE2b-256 e377406fcef1e11fabb14cedf67390806c5a3f953e169271381db8fb4e49e496

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipen_annotate-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1023-azure

File hashes

Hashes for pipen_annotate-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6275897a1483083c403351ff2d294f04dcf47dbb6be07b0c38ff30ef9da404
MD5 22bd8daae025b90292175d5a47d74231
BLAKE2b-256 9d2750bf3ed5f0be5d6ce90afc3952db2ea8a590b81a11039e269721a63a4483

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