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

@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}

print(Process.annotated)
# prints:
{'Envs': {'ncores': {'attrs': OrderedDiot([('default', 1), ('atype', 'int')]),
                     '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.1.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

pipen_annotate-0.1.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_annotate-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1033-azure

File hashes

Hashes for pipen_annotate-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f3dfa39f5203f576bcf649a6a5cc49934f4b51a1cf9cede34ffcc880f507ebde
MD5 b89ffcfb8cc9da0dabdfcae65cb0eae9
BLAKE2b-256 28c495a3312d15230b7bf826d216ec08b94f69cd6f8d5720e29a77a7b906d46f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pipen_annotate-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c07a5c56e4df318b30a050a81b31b537df69cf458d39295e7730dc809ed9ee16
MD5 9a668aabb169af790e98ea12d630d036
BLAKE2b-256 b4b67e377671e2cc662f73819b1ced12de22ff81e07395c0e2d8f10973574d40

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