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.5.0.tar.gz
(6.8 kB
view details)
Built Distribution
File details
Details for the file pipen_annotate-0.5.0.tar.gz
.
File metadata
- Download URL: pipen_annotate-0.5.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1034-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4bb5a9714a53f44cab02b86704f22372d4810245a9ccae5f00c1029d7c2ed3e |
|
MD5 | a4156238bc2dbf080f0330918344fa8b |
|
BLAKE2b-256 | 97eb7417ee88b3b0e323e0503245216b6d2cdff01ce5b23ba7f9217379ee4843 |
File details
Details for the file pipen_annotate-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: pipen_annotate-0.5.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1034-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d89687ea990c6c2ddcc559e54db2db5a22355bdbacae64736362efea16e94cef |
|
MD5 | d489b81f0c02b58936f4701917dc217f |
|
BLAKE2b-256 | f1bb83f77f0730c6b325bdef6244ab635374343bd9e3b68b14cee91e6cb5cefb |