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.1.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file pipen_annotate-0.4.1.tar.gz
.
File metadata
- Download URL: pipen_annotate-0.4.1.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1033-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 888f08911ec40768b7eb3f4e8ff5e53b2c8071efbef6a4289f5f49efe51bf0ec |
|
MD5 | b6c9a47c4a1caf447ab71d3fab054f2c |
|
BLAKE2b-256 | a18cb1f8216dc6b58b98aaad9075127a4f8a4c4b2e8b5d93670502d5a9100598 |
File details
Details for the file pipen_annotate-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: pipen_annotate-0.4.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1033-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50059e8a0e525b5e77ab900a1b75ccc51d75cd9df73c4a7e2c13b3fa30c042a5 |
|
MD5 | 75c82d93936ce1a7b087f5937112f4bc |
|
BLAKE2b-256 | c4dd1494be36e6bcb92b4a3258c1c384a2c9022083826688d6c2d471aade08f9 |