-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcli.py
36 lines (32 loc) · 876 Bytes
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from email.policy import default
from webscraping import execute
import click
@click.command()
@click.option("--input", type=click.File("r"), required=True)
@click.option("--output", type=str, required=True)
@click.option(
"--n",
type=int,
default=16,
show_default=True,
prompt="Enter the number of pages",
help="The number of pages. Each page contains contains 1 or more complaints",
)
@click.option(
"--start_from",
type=int,
default=1,
prompt="Select the start page to collect from",
help="Select the page position to start collect data",
)
@click.option(
"--alert",
type=bool,
default="y",
prompt="Show notification [y/N]",
help="Show a notification on task finishes.",
)
def cli(input, output, n, start_from, alert):
execute(input, output, n, start_from, alert)
if __name__ == "__main__":
cli()