MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / parse_args

Function parse_args

script/run_pdf2ppt_cli.py:40–144  ·  view source on GitHub ↗

Parse command-line arguments

()

Source from the content-addressed store, hash-verified

38
39
40def parse_args():
41 """Parse command-line arguments"""
42 parser = argparse.ArgumentParser(
43 description="PDF2PPT CLI - Convert PDF to editable PPT",
44 formatter_class=argparse.RawDescriptionHelpFormatter,
45 epilog="""
46Examples:
47 # Basic conversion (no AI)
48 python script/run_pdf2ppt_cli.py --input slides.pdf
49
50 # With AI enhancement
51 python script/run_pdf2ppt_cli.py --input slides.pdf --use-ai-edit --api-key sk-xxx
52
53 # Custom style
54 python script/run_pdf2ppt_cli.py --input slides.pdf --use-ai-edit --style "学术风格"
55
56Environment Variables:
57 DF_API_URL - Default LLM API URL
58 DF_API_KEY - Default API key
59 DF_MODEL - Default text model name
60"""
61 )
62
63 # Required arguments
64 parser.add_argument(
65 "--input",
66 required=True,
67 help="Input PDF file path"
68 )
69
70 # Optional arguments
71 parser.add_argument(
72 "--use-ai-edit",
73 action="store_true",
74 help="Enable AI enhancement (default: False)"
75 )
76
77 parser.add_argument(
78 "--api-url",
79 help="LLM API URL (default: from env DF_API_URL)"
80 )
81
82 parser.add_argument(
83 "--api-key",
84 help="LLM API key (default: from env DF_API_KEY)"
85 )
86
87 parser.add_argument(
88 "--image-api-url",
89 help="Image generation API URL (default: from env DF_IMAGE_API_URL)"
90 )
91
92 parser.add_argument(
93 "--image-api-key",
94 help="Image generation API key (default: from env DF_IMAGE_API_KEY)"
95 )
96
97 parser.add_argument(

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected