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 (type=int): Number of cores
    """
    input = "infile:file, invar"
    output = "outfile:file:output.txt"
    args = {'ncores': 1}

annotated = annotate(Process)
# returns:
{'Envs': {'ncores': {'attrs': {'type': 'int'},
                     'help': 'Number of cores',
                     'name': 'ncores',
                     'terms': {}}},
 'Input': {'infile': {'attrs': {'action': 'extend',
                                'itype': 'file',
                                'nargs': '+'},
                      'help': 'An input file',
                      'name': 'infile',
                      'terms': {}},
           'invar': {'attrs': {'action': 'extend',
                               'itype': 'var',
                               'nargs': '+'},
                     'help': 'An input variable',
                     'name': 'invar',
                     'terms': {}}},
 'Output': {'outfile': {'attrs': {'default': 'output.txt', 'otype': 'file'},
                        'help': 'The output file',
                        'name': 'outfile',
                        'terms': {}}},
 'Summary': {'long': 'Long description', '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-1.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipen_annotate-1.0.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for pipen_annotate-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b82eba69a1250e7b969714b8212a099f9aba48a1e234cf4519164cdc2170b145
MD5 4d9caa80b4e521f4a36689e7fe951c5c
BLAKE2b-256 bdf4049941be31e554bca12c1e02d6ed37ff3851792a99b5548a165f01565ea8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for pipen_annotate-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 461db7ed2d863028a9aa60d6739357447c45c1d9b036510365eedc08f17949d0
MD5 b4182174f9f4cf284699ded34d476a79
BLAKE2b-256 7902c4ac16d2e355419966c9d43e12f97e3c7aefef383092be79f6717d97a798

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page