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.4.tar.gz (96.2 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.4-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.4.tar.gz
  • Upload date:
  • Size: 96.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pipen_annotate-1.0.4.tar.gz
Algorithm Hash digest
SHA256 9d6a3015d80e7802e53d5657e221a04fb76294322e2f00708ce403f1cf43e42a
MD5 68342260df74f56e8189e6662a3c9194
BLAKE2b-256 1ebf98bcc0306eaa69532cc4b0590757e9da977aaa6a577fe3e51bfb5e0c9116

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pipen_annotate-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ba5c13caa3f33d6f929b845763a16ac2cc1f4db00565d9373d165fdbfd95ed60
MD5 376d0cac482666d635fb3c8bef17d5ff
BLAKE2b-256 0bf9be9a1e2cc7dbd8d2e369ad2a989f0b3f57962e4562369cf7c87c4826747b

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