pipen-board


Namepipen-board JSON
Version 0.16.2 PyPI version JSON
download
home_pageNone
SummaryVisualization configuration and running of pipen pipelines on the web
upload_time2024-08-17 04:38:57
maintainerNone
docs_urlNone
authorpwwang
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pipen-board

Visualize configuration and running of [pipen][1] pipelines on the web.

![pipen-board](https://pwwang.github.io/immunopipe/pipen-board.gif)

## Installation

```bash
pip install pipen-board
```

## Usage

```bash
$ pipen board --help
Usage: pipen board [options] <pipeline> -- [pipeline options]

Configure and run pipen pipelines from the web

Required Arguments:
  pipeline              The pipeline and the CLI arguments to run the pipeline. For the
                        pipeline either `/path/to/pipeline.py:<pipeline>` or
                        `<module.submodule>:<pipeline>` `<pipeline>` must be an instance of
                        `Pipen` and running the pipeline should be called under `__name__ ==
                        '__main__'.

Optional Arguments:
  -h, --help            show help message and exit
  -p PORT, --port PORT  Port to serve the UI wizard [default: 18521]
  -a FILE, --additional FILE
                        Additional arguments for the pipeline, in YAML, INI, JSON or TOML
                        format. Can have sections `ADDITIONAL_OPTIONS` and `RUNNING_OPTIONS`.
                        It can also have other sections and items to override the
                        configurations generated from the pipeline. If the pipeline is
                        provided as a python script, such as
                        `/path/to/pipeline.py:<pipeline>`, and `<pipeline>` runs under
                        `__name__ == '__main__'`, the additional file can also be specified
                        as `auto` to generate a `RUNNING OPTIONS/Local` section to run the
                        pipeline locally.
  --loglevel {auto,debug,info,warning,error,critical}
                        The logging level. If `auto`, it will be set to `debug` if `--dev` is
                        set, otherwise `info`. [default: auto]
  --dev                 Run the pipeline in development/debug mode. This will reload the
                        server when changes are made to this package and reload the pipeline
                        when page reloads for new configurations. Page cache is also disabled
                        in this mode.
  -w WORKDIR, --workdir WORKDIR
                        The working directory of the pipeline. [default: .pipen]
  -s SCHEMA_DIR, --schema-dir SCHEMA_DIR
                        The directory to store the configuration schemas. [default: ~/.pipen-
                        board]
```

## Describing arguments in docstring

### Docstring schema

```python
class ProcessOrProcessGroup:
    """Short summary

    Long description
    Long description

    Args:
        arg1 (<metadata>): description
            - subarg1 (<metadata>): description
            - subarg2 (<metadata>): description
        arg2 (<metadata>): description

    <Other Sections>:
        <content>
    """
```

The metadata can have multiple attributes, separated by semicolon (`;`). For example:

```
arg1 (action=ns;required): description
```

### Marks

You can mark a process using `pipen.utils.mark(<mark>=<value>)` as a decorator to decorate a process. For example:

```python
from pipen import Proc
from pipen.utils import mark

@mark(board_config_no_input=True)
class MyProc(Proc):
    pass
```

Available marks:

- `board_config_no_input`: Whether to show the input section for the process in configuation page. Only affects the start processes. Default to `False`.
- `board_config_hidden`: Whether to hide the process options in the configuration page. Note that the process is still visible in the process list. Default to `False`.

### Metadata for arguments


| Name     | Description | Allowed values |
| -------- | ----------- | -------------- |
| `action` | Like the `action` argument in [`argx`][2]*. | `store_true`, `store_false`, `ns`, `namespace`, `append`, `extend`, `clear_append`, `clear_extend` (other values are allowed but ignore, they may be effective for CLI use) |
| `btype`  | Board type (option type specified directly). If specified, `action` will be ignored | `ns`, `choice`, `mchoice`, `array`, `list`, `json`, `int`, `float`, `bool`, `str`, `text`, `auto`* |
| `type` | Fallback for `action` and `btype` | Same as `btype` |
| `flag` | Fallback for `action=store_true` | No values needed |
| `text`/`mline`/`mlines` | Shortcut for `btype=text` | No values needed |
| `ns`/`namespace` | Shortcut for `btype=ns` | No values needed |
| `choices`/`choice` | Shortcut for `btype=choice` | No values needed |
| `mchoices`/`mchoice` | Shortcut for `btype=mchoice` | No values needed |
| `array`/`list` | Shortcut for `btype=array`/`btype=list` | No values needed |
| `choices`/`choice` | Shortcut for `btype=choice` | No values needed |
| `mchoices`/`mchoice` | Shortcut for `btype=mchoice` | No values needed |
| `order` | The order of the argument in the UI. | Any integer |
| `readonly` | Whether the argument is readonly. | No values needed (True if specified, otherwise False) |
| `required` | Whether the argument is required. | No values needed (True if specified, otherwise False) |
| `placeholder` | The placeholder in the UI for the argument. | Any string |
| `bitype` | The type of the elements in an array or list. | `int`, `float`, `bool`, `str`, `json`, `auto`* |
| `itype` | Fallback for `bitype` | Same as `bitype` |

- `argx*`: An argument parser for Python, compatible with `argparse`.
- `auto*`: Automatically infer the type from a string value.
  - Any of `True`, `TRUE`, `true`, `False`, `FALSE`, `false` will be inferred as a `bool` value.
  - Any of `None`, `NONE`, `none`, `null`, `NULL` will be inferred as `None`.
  - Any integers will be inferred as `int`.
  - Any floats will be inferred as `float`.
  - Try to parse the value as JSON. If succeed, the value will be inferred as `json`.
  - Otherwise, the value will be inferred as `str`.

### Types of options in the UI

The type of an option in the UI is determined by the `btype`, `action` or `type` metadata. If neither is specified, a `PlainText` will be used.

- `BoolOption`: Shown as a switch
- `TextOption`: Shown as a textarea (allow multiple lines)
- `ChoiceOption`: Shown as a dropdown list (`subarg1` and `subarg2` in the example above are used as the choices)
- `MChoiceOption`: Shown as a multiple choice list (`subarg1` and `subarg2` in the example above are used as the choices)
- `JsonOption`: Shown as a textarea, but the value will be validated and parsed as JSON
- `ArrayOption`: Shown as a tag input. Items can be added or removed.
- `AutoOption`: Shown as a 1-row textarea, and the value will be parsed automatically
- `PlainText`: Shown as a plain text. No validation or parsing will be performed.
- `MoreLikeOption`: Show as a box with buttons to add or remove sub-options. It's usally used together with `ns` type. If there is a sub-option under the option in the docstring wrapped by `<...>`, it indicates that we may have more sub-options.


[1]: https://github.com/pwwang/pipen
[2]: https://github.com/pwwang/argx

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pipen-board",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "pwwang",
    "author_email": "pwwang@pwwang.com",
    "download_url": "https://files.pythonhosted.org/packages/02/90/7f55c76a2530ca8beb53df461824c609913af3bd5460cd454ceb359470fe/pipen_board-0.16.2.tar.gz",
    "platform": null,
    "description": "# pipen-board\n\nVisualize configuration and running of [pipen][1] pipelines on the web.\n\n![pipen-board](https://pwwang.github.io/immunopipe/pipen-board.gif)\n\n## Installation\n\n```bash\npip install pipen-board\n```\n\n## Usage\n\n```bash\n$ pipen board --help\nUsage: pipen board [options] <pipeline> -- [pipeline options]\n\nConfigure and run pipen pipelines from the web\n\nRequired Arguments:\n  pipeline              The pipeline and the CLI arguments to run the pipeline. For the\n                        pipeline either `/path/to/pipeline.py:<pipeline>` or\n                        `<module.submodule>:<pipeline>` `<pipeline>` must be an instance of\n                        `Pipen` and running the pipeline should be called under `__name__ ==\n                        '__main__'.\n\nOptional Arguments:\n  -h, --help            show help message and exit\n  -p PORT, --port PORT  Port to serve the UI wizard [default: 18521]\n  -a FILE, --additional FILE\n                        Additional arguments for the pipeline, in YAML, INI, JSON or TOML\n                        format. Can have sections `ADDITIONAL_OPTIONS` and `RUNNING_OPTIONS`.\n                        It can also have other sections and items to override the\n                        configurations generated from the pipeline. If the pipeline is\n                        provided as a python script, such as\n                        `/path/to/pipeline.py:<pipeline>`, and `<pipeline>` runs under\n                        `__name__ == '__main__'`, the additional file can also be specified\n                        as `auto` to generate a `RUNNING OPTIONS/Local` section to run the\n                        pipeline locally.\n  --loglevel {auto,debug,info,warning,error,critical}\n                        The logging level. If `auto`, it will be set to `debug` if `--dev` is\n                        set, otherwise `info`. [default: auto]\n  --dev                 Run the pipeline in development/debug mode. This will reload the\n                        server when changes are made to this package and reload the pipeline\n                        when page reloads for new configurations. Page cache is also disabled\n                        in this mode.\n  -w WORKDIR, --workdir WORKDIR\n                        The working directory of the pipeline. [default: .pipen]\n  -s SCHEMA_DIR, --schema-dir SCHEMA_DIR\n                        The directory to store the configuration schemas. [default: ~/.pipen-\n                        board]\n```\n\n## Describing arguments in docstring\n\n### Docstring schema\n\n```python\nclass ProcessOrProcessGroup:\n    \"\"\"Short summary\n\n    Long description\n    Long description\n\n    Args:\n        arg1 (<metadata>): description\n            - subarg1 (<metadata>): description\n            - subarg2 (<metadata>): description\n        arg2 (<metadata>): description\n\n    <Other Sections>:\n        <content>\n    \"\"\"\n```\n\nThe metadata can have multiple attributes, separated by semicolon (`;`). For example:\n\n```\narg1 (action=ns;required): description\n```\n\n### Marks\n\nYou can mark a process using `pipen.utils.mark(<mark>=<value>)` as a decorator to decorate a process. For example:\n\n```python\nfrom pipen import Proc\nfrom pipen.utils import mark\n\n@mark(board_config_no_input=True)\nclass MyProc(Proc):\n    pass\n```\n\nAvailable marks:\n\n- `board_config_no_input`: Whether to show the input section for the process in configuation page. Only affects the start processes. Default to `False`.\n- `board_config_hidden`: Whether to hide the process options in the configuration page. Note that the process is still visible in the process list. Default to `False`.\n\n### Metadata for arguments\n\n\n| Name     | Description | Allowed values |\n| -------- | ----------- | -------------- |\n| `action` | Like the `action` argument in [`argx`][2]*. | `store_true`, `store_false`, `ns`, `namespace`, `append`, `extend`, `clear_append`, `clear_extend` (other values are allowed but ignore, they may be effective for CLI use) |\n| `btype`  | Board type (option type specified directly). If specified, `action` will be ignored | `ns`, `choice`, `mchoice`, `array`, `list`, `json`, `int`, `float`, `bool`, `str`, `text`, `auto`* |\n| `type` | Fallback for `action` and `btype` | Same as `btype` |\n| `flag` | Fallback for `action=store_true` | No values needed |\n| `text`/`mline`/`mlines` | Shortcut for `btype=text` | No values needed |\n| `ns`/`namespace` | Shortcut for `btype=ns` | No values needed |\n| `choices`/`choice` | Shortcut for `btype=choice` | No values needed |\n| `mchoices`/`mchoice` | Shortcut for `btype=mchoice` | No values needed |\n| `array`/`list` | Shortcut for `btype=array`/`btype=list` | No values needed |\n| `choices`/`choice` | Shortcut for `btype=choice` | No values needed |\n| `mchoices`/`mchoice` | Shortcut for `btype=mchoice` | No values needed |\n| `order` | The order of the argument in the UI. | Any integer |\n| `readonly` | Whether the argument is readonly. | No values needed (True if specified, otherwise False) |\n| `required` | Whether the argument is required. | No values needed (True if specified, otherwise False) |\n| `placeholder` | The placeholder in the UI for the argument. | Any string |\n| `bitype` | The type of the elements in an array or list. | `int`, `float`, `bool`, `str`, `json`, `auto`* |\n| `itype` | Fallback for `bitype` | Same as `bitype` |\n\n- `argx*`: An argument parser for Python, compatible with `argparse`.\n- `auto*`: Automatically infer the type from a string value.\n  - Any of `True`, `TRUE`, `true`, `False`, `FALSE`, `false` will be inferred as a `bool` value.\n  - Any of `None`, `NONE`, `none`, `null`, `NULL` will be inferred as `None`.\n  - Any integers will be inferred as `int`.\n  - Any floats will be inferred as `float`.\n  - Try to parse the value as JSON. If succeed, the value will be inferred as `json`.\n  - Otherwise, the value will be inferred as `str`.\n\n### Types of options in the UI\n\nThe type of an option in the UI is determined by the `btype`, `action` or `type` metadata. If neither is specified, a `PlainText` will be used.\n\n- `BoolOption`: Shown as a switch\n- `TextOption`: Shown as a textarea (allow multiple lines)\n- `ChoiceOption`: Shown as a dropdown list (`subarg1` and `subarg2` in the example above are used as the choices)\n- `MChoiceOption`: Shown as a multiple choice list (`subarg1` and `subarg2` in the example above are used as the choices)\n- `JsonOption`: Shown as a textarea, but the value will be validated and parsed as JSON\n- `ArrayOption`: Shown as a tag input. Items can be added or removed.\n- `AutoOption`: Shown as a 1-row textarea, and the value will be parsed automatically\n- `PlainText`: Shown as a plain text. No validation or parsing will be performed.\n- `MoreLikeOption`: Show as a box with buttons to add or remove sub-options. It's usally used together with `ns` type. If there is a sub-option under the option in the docstring wrapped by `<...>`, it indicates that we may have more sub-options.\n\n\n[1]: https://github.com/pwwang/pipen\n[2]: https://github.com/pwwang/argx\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Visualization configuration and running of pipen pipelines on the web",
    "version": "0.16.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e044ef0ecd16fd5854c2d566db0351012250390977007382877ef8d54594b08",
                "md5": "115267408b29256c38f3476f1fb33ccb",
                "sha256": "a277f8b94cbd8e0e5112b0c402f04b470a695c0826246dfed53f274c9cd116b5"
            },
            "downloads": -1,
            "filename": "pipen_board-0.16.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "115267408b29256c38f3476f1fb33ccb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 581121,
            "upload_time": "2024-08-17T04:38:55",
            "upload_time_iso_8601": "2024-08-17T04:38:55.577973Z",
            "url": "https://files.pythonhosted.org/packages/9e/04/4ef0ecd16fd5854c2d566db0351012250390977007382877ef8d54594b08/pipen_board-0.16.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "02907f55c76a2530ca8beb53df461824c609913af3bd5460cd454ceb359470fe",
                "md5": "de7ad12a69e46fe6a2c81f35056ef12b",
                "sha256": "5a01e52b6c4426a6f7e4f3d170bef3b441e7b8a0145ed77a46f2af870e622315"
            },
            "downloads": -1,
            "filename": "pipen_board-0.16.2.tar.gz",
            "has_sig": false,
            "md5_digest": "de7ad12a69e46fe6a2c81f35056ef12b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 578535,
            "upload_time": "2024-08-17T04:38:57",
            "upload_time_iso_8601": "2024-08-17T04:38:57.506135Z",
            "url": "https://files.pythonhosted.org/packages/02/90/7f55c76a2530ca8beb53df461824c609913af3bd5460cd454ceb359470fe/pipen_board-0.16.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-17 04:38:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pipen-board"
}
        
Elapsed time: 0.30430s