Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pipen-args logo

Command line argument parser for pipen

Usage

from pipen import Proc, Pipen


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>-output]
  --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.

Plugin options

  • args_hide: (process level) Hide the arguments in the help message. Default: False
  • args_group: (pipeline level) The group name for the arguments. Default: pipeline options
  • args_flatten: (pipeline level) Flatten the arguments in the help message when there is only one process in the pipeline. Default: auto (flatten if single process, otherwise not)
  • args_dump: (pipeline level) Whether to dump the arguments to <outdir>/args.toml file. Default: False.

[!NOTE] Only args_dump can be passed from the command line or a configuration file. Other options can only be set in the pipeline class, passed to the Pipen construct. Because they are used to construct the argument parser and we don't know the value of these options before the argument parser is constructed.

Metadata for Proc envs 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.

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-1.3.0a1.tar.gz (180.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipen_args-1.3.0a1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file pipen_args-1.3.0a1.tar.gz.

File metadata

  • Download URL: pipen_args-1.3.0a1.tar.gz
  • Upload date:
  • Size: 180.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pipen_args-1.3.0a1.tar.gz
Algorithm Hash digest
SHA256 b13682839fc0f34f2b79ca2fd12eda6facaaa496ee304728de42259096523c05
MD5 a5ded304b417c4e4284f2352662aea2c
BLAKE2b-256 d5a28f021fcbd06a15957eebb6eef23584b0951cf3ab8fb79c5945e14f54df19

See more details on using hashes here.

File details

Details for the file pipen_args-1.3.0a1-py3-none-any.whl.

File metadata

  • Download URL: pipen_args-1.3.0a1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pipen_args-1.3.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc9e1cde1584a0742c775c891893b8652257ecc25614b326b5320d4820074808
MD5 2d7667fed55be9ca350b03d620bd8f1b
BLAKE2b-256 f1dd5198f90ad9ccfdf40aa040f42527b52ae2eb9721f9edbfe8ed9546308a30

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page