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.0.tar.gz (9.4 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.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.0.tar.gz
  • Upload date:
  • Size: 9.4 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.0.tar.gz
Algorithm Hash digest
SHA256 208dedfcbb26aa95e7ea0d7792632c9209209d65b5f8382972c5e163355b8201
MD5 0689561963845fbafada48f365e8e76c
BLAKE2b-256 f903902971b288c821a6d6625ae18d3f243baabbb68a39586f42b07039687fb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c28c4dfb3bd2b6428c167e04a4be928b75b615e8ca4ffcdbef503fdf2ae3d78e
MD5 33785993237209a216a6a7bd919f1042
BLAKE2b-256 9341d35d06f10cf1eecf06abc05d3c176d6a4cbb6001e4c400df8e06b8e2ac01

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