pconfiged¶

pconfigs.pconfiged(_cls=None, *, runnable=False, mock=False)[source]¶

Decorator that creates a pconfiged object.

See also

For examples, see Construction.

When used with keyword options, it behaves as follows.

Parameters:
  • runnable (bool, optional) – If True, the class can be run with python -m pconfigs.run dot.path.to.config, where the dot‑path specifies an object within a Python module. The class will expose a main method with signature def main(self, args: Namespace, others: List[str]) -> int. The args parameter will have a single value, args.config, which is the dot-path of the config (for example, dot.path.to.config). See pconfigs.config_runner.ConfigRunnable for more details.

  • mock (bool, optional) – If True, the pconfiged class may come from an external library that uses simple, keyword-only arguments to define its configuration.