Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pwwang/pyppl_annotate
Adding long description/annotations for PyPPL processes.
https://github.com/pwwang/pyppl_annotate
Last synced: 14 days ago
JSON representation
Adding long description/annotations for PyPPL processes.
- Host: GitHub
- URL: https://github.com/pwwang/pyppl_annotate
- Owner: pwwang
- License: mit
- Created: 2019-12-27T00:11:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-17T17:16:57.000Z (almost 5 years ago)
- Last Synced: 2024-12-10T04:27:12.817Z (24 days ago)
- Language: Python
- Size: 27.3 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyppl_annotate
Adding long description/annotation for PyPPL processes.
## Installation
```shell
pip install pyppl_annotate
```## Usage
```python
p = Proc(
config = {
'annotate': """
An awesome process
@input:
infile: The input file
@output:
outfile: The output file
@config:
report_template: The report template file
@custome_section:
blah
""",
'report_template': '/path/to/report_template'}
input = 'infile:file',
output = 'outfile:file:output.txt',
args = {'a': 1}
)p.config.annotate.description == 'An awesome process\n'
p.config.annotate.input = {
'infile': {'type': 'file', 'desc': 'The input file\n', 'default': ''}}
p.config.annotate.output = {
'outfile': {'type': 'file', 'desc': 'The output file\n', 'default': 'output.txt'}}
}
p.config.annotate.args = {
'a': {'type': 'int', 'desc': '', 'default': 1}
}
p.config.annotate.config = {
'report_template': {'type': 'str', 'desc': 'The report template file\n',
'default': '/path/to/report_template'}
}
p.config.annotate.section('nonexist') is None
p.config.annotate.section('custome_section') == 'blan\n'
p.config.annotate.section('custome_section',
formatter = lambda value, proc: proc.id + ':' + value) == 'p: blan\n'
```