Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pwwang/pipen-annotate
Use docstring to annotate pipen processes
https://github.com/pwwang/pipen-annotate
Last synced: 14 days ago
JSON representation
Use docstring to annotate pipen processes
- Host: GitHub
- URL: https://github.com/pwwang/pipen-annotate
- Owner: pwwang
- License: mit
- Created: 2020-12-11T07:07:27.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-23T22:06:38.000Z (5 months ago)
- Last Synced: 2024-12-13T03:51:33.669Z (21 days ago)
- Language: Python
- Homepage:
- Size: 368 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pipen-annotate
Use docstring to annotate [pipen](https://github.com/pwwang/pipen) processes
## Installation
```shell
pip install -U pipen-annotate
```## Usage
```python
from pprint import pprint
from pipen import Proc
from pipen_annotate import annotateclass Process(Proc):
"""Short descriptionLong description
Input:
infile: An input file
invar: An input variableOutput:
outfile: The output fileEnvs:
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)]),
'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'}}
```