ordeq_args
CommandLineArg
¶
Bases: Input[T]
Dataset that represents a command line argument as node input. Useful for parameterization of node logic based on arguments in the run command.
Parses the argument from sys.argv on load. See
argparse for more
information.
Example:
| main.py | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
When you run transform through the CLI as follows:
1 | |
MyValue will be used as value in transform.
By default, the command line arguments are parsed as string. You can parse as different type using built-in type converters, for instance:
1 2 3 4 5 6 7 8 | |
Alternatively, you can parse using a user-defined function, e.g.:
1 2 3 4 5 | |
When using multiple CommandLineArg IOs in a node, then you can link them
to the same argument parser:
1 2 3 4 5 | |
Parsing command line arguments as argparse.FileType is discouraged as
it has been deprecated
from Python 3.14.
More info on parsing types here
EnvironmentVariable
dataclass
¶
Bases: IO[str]
IO used to load and save environment variables. Use: - as input, to parameterize the node logic - as output, to set an environment variable based on node logic
Gets and sets os.environ on load and save. See the Python docs for more
information.
Example in a node:
| main.py | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
When you run transform through the CLI as follows:
1 2 | |
MyValue will be used as value in transform.