We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Easily change settings just from process arguments. There's probably something like that in Hydra, unsure.
from configzen import ConfigModel, ConfigField, cli_param class MyModel(ConfigModel): debug: bool = ConfigField(alias="debug_mode", cli_param=cli_param("-d", "--debug")) verbose: bool = ConfigField.cli_param("-v", "--verbose") def _cli_callback(self): ...
Integrate with argparse:
argparse
parser = argparse.ArgumentParser() ... arguments = MyModel.cli.get_parser_arguments() for nf_args, options in arguments.items(): parser.add_argument(*nf_args, **options)
parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() ... subparsers.add_parser(MyModel.cli.as_parser("name"))
Integrate with click:
click
if __name__ == "__main__": MyModel.cli()
Integrate with typer:
typer
app = typer.Typer() app.add_typer(MyModel.cli.typer())
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the use case of a new functionality
Easily change settings just from process arguments. There's probably something like that in Hydra, unsure.
Example Use
Integrate with
argparse
:Integrate with
click
:Integrate with
typer
:Additional context
No response
The text was updated successfully, but these errors were encountered: