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
@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}
print(Process.annotated)
# 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.1.3.tar.gz
(5.6 kB
view details)
Built Distribution
File details
Details for the file pipen_annotate-0.1.3.tar.gz
.
File metadata
- Download URL: pipen_annotate-0.1.3.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1033-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f0361fc62def7e1e78371ea3851103b82ecea8b6326f865043d0e5f88436f9 |
|
MD5 | 7fb667212f9d3e1363d7228336e53b81 |
|
BLAKE2b-256 | f28660a3d2c975f7d83077b7c1ac52521a19c6c260a6e8f91979617af9837e5d |
File details
Details for the file pipen_annotate-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: pipen_annotate-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1033-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d72895a39657179da3c8bd02b399df6a8001ee4a3f3b0654de495594b041773 |
|
MD5 | d63aa744ad3407e06b9173876e766343 |
|
BLAKE2b-256 | a7f83de745075b364748600e01cce3ba95079bc53304d8189337dd9fe0b8b1b8 |