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: Number of cores
"""
input = "infile:file, invar"
output = "outfile:file:output.txt"
args = {'ncores': 1}
annotated = annotate(Process)
# 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
Release history Release notifications | RSS feed
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.4.4.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for pipen_annotate-0.4.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7db6aad20e7f3cf17e46bcf5de28254d9ab71a10751c24559b6e28dbd040b87c |
|
MD5 | 7d2f6ac14f7f4a6d09f97f5ac8a87ffb |
|
BLAKE2b-256 | f29b56606f0272391829c82a9ad7a86a922eec56ac8a9e3a15e6d159c5ccc5e6 |