Cli
cli ¶
Command-line interface for equities-classifier.
main(argv: Sequence[str] | None = None) -> None ¶
Run the command-line interface.
Source code in src/equities_classifier/processflow/cli.py
def main(
argv: Sequence[str] | None = None,
) -> None:
"""Run the command-line interface."""
parser = _create_parser()
args = parser.parse_args(argv)
# No input/output parameters: start GUI.
if args.input is None and args.output is None:
run_gui()
return
# Input and output must be specified together.
if args.input is None or args.output is None:
parser.error("input and output must be specified together")
identifiers = read_identifiers(args.input)
processflow = ProcessFlow(
morningstar=args.morningstar,
motleyfool=args.motleyfool,
seekingalpha=args.seekingalpha,
yahoo=args.yahoo
)
securities = processflow.run(identifiers)
write_excel(
securities,
args.output,
classifications=get_classification_output(
args.morningstar,
args.motleyfool or args.seekingalpha,
),
provider_details=True,
)