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.3.tar.gz (95.7 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.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.3.tar.gz
  • Upload date:
  • Size: 95.7 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.3.tar.gz
Algorithm Hash digest
SHA256 deea28d765336e08699c4ccdbfdb19a1215995877d2bd9c8e5f23e0b8e3ee9a5
MD5 22074d9ca0b042021cc746165d6fd886
BLAKE2b-256 2cad0d60f7b4d3b0ea9caa0a4eb8f773d96226dff0002b9e99913f60334089db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipen_annotate-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f271ee69871f71432d94024eba0c590813e652f1df3db78595ddc11781b9c86
MD5 f30e024c995ea37c54a23b6700b9fb12
BLAKE2b-256 9cda6578321c555147368253fc8d9b2f76742a11aed9fb56131e62eb1fea838b

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