Skip to main content

Command-line argument parser for pipen.

Project description

pipen-args

Command line argument parser for pipen

Usage

from pipen import Proc, Pipen
# Note that unlike other plugins, you need to import install
# to activate the plugin
from pipen_args import install  # noqa: F401

class Process(Proc):
    """My process

    Input:
        a: Input data
    """
    input = 'a'
    input_data = range(10)
    script = 'echo {{in.a}}'

Pipen().set_start(Process).run()
$ python example.py --help
Usage: test.py [-h | -h+] [options]

Undescribed process.
Use `@configfile` to load default values for the options.

Pipeline Options:
  --name NAME           The name for the pipeline, will affect the default workdir and
                        outdir. [default: pipen-0]
  --profile PROFILE     The default profile from the configuration to run the pipeline.
                        This profile will be used unless a profile is specified in the
                        process or in the .run method of pipen. You can check the
                        available profiles by running `pipen profile`
  --outdir OUTDIR       The output directory of the pipeline [default: ./<name>_results]
  --forks FORKS         How many jobs to run simultaneously by the scheduler
  --scheduler SCHEDULER
                        The scheduler to run the jobs

Namespace <in>:
  --in.a A [A ...]      Input data

Optional Arguments:
  -h, --help, -h+, --help+
                        show help message (with + to show more options) and exit

See more examples in tests/pipelines/ folder.

Metadata for env items

The metadata in the docstring of env items determines how the arguments are defined.

class Process(Proc):
    """My process

    # other docstring sections

    Envs:
        a (<metadata>): ...

The metadata could be key-value pairs separated by ;. The separator : or = is used to separate the key and value. The value is optional. If the value is not specified, it will be set to True. The keys are valid arguments of argx.ArgumentParser.add_argument, except that hidden will be interpreted as show=False in argx.ArgumentParser.add_argument. If the value of choices is not specified, the subkeys of the env item will be used as the choices.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipen_args-0.8.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

pipen_args-0.8.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file pipen_args-0.8.0.tar.gz.

File metadata

  • Download URL: pipen_args-0.8.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.2 Linux/5.15.0-1034-azure

File hashes

Hashes for pipen_args-0.8.0.tar.gz
Algorithm Hash digest
SHA256 35d8bcf1b0570655db5192715c7fc8bc779b9d329c55ec2941fe65a6d3255787
MD5 d0e33f13b01eac01a3c91bafcd0f1267
BLAKE2b-256 3dd7ec9f0e5add13e54343842e7848423831144e1957e1aee09e3669956e19c6

See more details on using hashes here.

File details

Details for the file pipen_args-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: pipen_args-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.2 Linux/5.15.0-1034-azure

File hashes

Hashes for pipen_args-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84d8fbafd8753e02df4eab122714ab8e51a70499d25bfe2cb04e4d8ffde851bf
MD5 6a71ad33aee4961401e819664dde7667
BLAKE2b-256 cd97a3f62daa593b3c63e667f531fcdafe9bdb12db341bc11f5484685053c7fa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page