Command-line argument parser for pipen.
Project description
pipen-args
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>_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 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pipen_args-0.9.1.tar.gz
.
File metadata
- Download URL: pipen_args-0.9.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05a30801fa81dbbf6b8798d7219129aa9ed4f113b63c2b95291bafe1df831e4e |
|
MD5 | 13d574564bab8e7636ee9a58003483a7 |
|
BLAKE2b-256 | f62f4216412b309a60e41bd984a951c1a5ff0706757d6758dd181604583cd736 |
File details
Details for the file pipen_args-0.9.1-py3-none-any.whl
.
File metadata
- Download URL: pipen_args-0.9.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1035-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2168d0fe7efa6ff14d087cdbabe5c918f17113c0b747e44801c8252117b56e1 |
|
MD5 | dd023afcf24c25d55ef8313912d9160c |
|
BLAKE2b-256 | 3c03858da823c644775dc2be29ec2600ff63bbe81e733420105525d09d8274d4 |