Coverage for src/cycloplanning/cli.py: 0%

1 import click

2

3 from cycloplanning import create_ics, get_html, parse_events, parse_html, write_ics

4

5 CYCLOPLANNING_URL = "https://lite.framacalc.org/cycloplanning.html"

6

7

8@click.command()

9@click.option(

10 "-o",

11 "--output",

12 type=click.STRING,

13 default="/dev/stdout",

14)

15@click.option(

16 "--url",

17 type=click.STRING,

18 default=CYCLOPLANNING_URL,

19)

20 def main(output: str, url: str):

21 write_ics(create_ics(parse_events(parse_html(get_html(url)))), output)

22

23

24 if __name__ == "__main__":

25 main()