semvec/pypi-packages huggingface dataset:
pipen-cli-run 1.0.2
A pipen cli plugin to run a process or a pipeline
License: MIT
Requires Python: <4.0,>=3.9

# pipen-cli-run

A pipen cli plugin to run a process or a pipeline

## Install

```shell
pip install -U pipen-cli-run
```

## Usage

### Register a namespace

`pyproject.toml`
```toml
[tool.poetry.plugins.pipen_cli_run]
ns = "yourpackage.ns"
```

`ns` should be a module where you define you processes/pipelines
pipen-cli-require 1.0.2
A pipen cli plugin to check requirements for processes of a pipeline
License: MIT
Requires Python: <4.0,>=3.9

# pipen-cli-require

Checking the requirements for processes of a [pipen][1] pipeline

## Install

```shell
pip install -U pipen-cli-require
```

## Usage

### Defining requirements of a process

```python
# example_pipeline.py
from pipen import Pipen, Proc

class P1(Proc):
    """Process 1

    Requires:
        pipen: Run `pip install -U pipen` to install
          - check: |
            {{proc.lang}} -c "import pipen"
        liquidpy: Run `pip install -U liquidpy` to install
          - check: |
            {{proc.lang}} -c "import liquid"
        nonexist: Run `pip install -U nonexist` to install
          - check: |
            {{proc.lang}} -c "import nonexist"
        conditional:
          - if: {{envs.require_conditional}}
          - check:
            {{proc.lang}} -c "import optional"

    """
    input = "a"
    output = "outfile:file:out.txt"
    envs = {"require_conditional": False}
    lang = "python"

# Setup the pipeline
# Must be outside __main__
# Or define a function to return the pipeline
class Pipeline(Pipen):
    starts = P1


if __name__ == '__main__':
    # Pipeline must run with __main__
    Pipeline().run()
```

### Parsing process requirements using API

```python
from pipen_cli_require import parse_proc_requirements


def parse_proc_requirements(
    proc: Type[Proc]
) -> Tuple[OrderedDiot, OrderedDiot]:
    """Parse the requirements of a process

    Args:
        proc: The process class

    Returns:
        A tuple of two OrderedDiot's.
        The first one is the annotated sections by pipen_annotate
        The second one is the requirements. The key is the name of the
            requirement, the value is a dict with message, check and if_ keys.
    """
```

## Checking the requirements via the CLI

```shell
> pipen require --verbose --ncores 2 -p example_pipeline.py:pipeline

Checking requirements for pipeline: PIPEN-0
│
└── P1: Process 1
    ├── ✅ pipen
    ├── ✅ liquidpy
    ├── ❎ nonexist: Run `pip install -U nonexist` to install
    │   └── Traceback (most recent call last):
    │         File "<string>", line 1, in <module>
    │       ModuleNotFoundError: No module named 'nonexist'
    │
    └── ⏩ conditional (skipped by if-statement)
```

## Checking requirements with runtime arguments

For example, when I use a different python to run the pipeline:

Add this to the head of `example_pipeline.py`:

```python
import pipen_args
```

See also `tests/pipen_args_pipeline.py`

Then specify the path of the python to use:

```shell
pipen require example_pipeline.py:pipeline --P1.lang /path/to/another/python
```

[1]: https://github.com/pwwang/pipen
pipen-cli-ref 1.0.2
Make API reference documentation for pipen pipeline/processes
License: MIT
Requires Python: <4.0,>=3.9

# pipen-cli-ref
Make reference documentation for [pipen][1] pipeline/processes

## Installation

```bash
pip install pipen-cli-ref
```

## Usage

```bash
pipen ref --help
```

```
Usage: pipen ref [-h] -p PIPELINE -d DESTDIR [-s] [-r REPLACE_TITLES]
                 [-i HIDE_SECTIONS]

Make API reference documentation for pipen pipeline/processes.

Required Arguments:
  -p PIPELINE, --pipeline PIPELINE
                        Specify the pipeline to generate the docs for, in the
                        format of `part1:part2` where `part1` could be either:
                        1. a package name that can be imported by
                        `importlib.import_module`, or
                        2. a submodule of a package, for example,
                        `package.module`; or
                        3. a path to a python file, for example,
                        `path/to/file.py`.
                        and `part2` is the name of the pipeline class.
                        When the module is loaded, the pipeline class will be
                        searched in the module.
  -d DESTDIR, --destdir DESTDIR
                        The destination directory to save the docs.

Options:
  -h, --help            show help message and exit
  -s, --show-hidden-items
                        Do not include hidden items.
  -r REPLACE_TITLES, --replace-titles REPLACE_TITLES
                        Replace the title of a section, in the format of
                        `old=new`. Multiple replacements can be specified.
  -i HIDE_SECTIONS, --hide-sections HIDE_SECTIONS
                        Hiden some sections in docstring
```

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