# myice ## introduction With this tool, you can fetch kids' schedules from MyIce and generate the PDFs you need. ## install with [uv](https://docs.astral.sh/uv/getting-started/installation/): ```shell uv tool install --extra-index-url https://gitea.parano.ch/api/packages/herel/pypi/simple/ myice ``` with [pipx](https://pipx.pypa.io/stable/installation/): ```shell pipx install --extra-index-url https://gitea.parano.ch/api/packages/herel/pypi/simple/ myice ``` ## configuration Create a `myice.ini` file with your credentials: ```ini [default] username = your_email@example.com password = your_password userid = 12345 token = your_api_token club_id = 172 ``` You can also create multiple sections for different users: ```ini [default] username = user1@example.com password = password1 userid = 12345 token = token1 club_id = 172 [second_kid] username = charlie@example.com password = password2 userid = 67890 token = token2 club_id = 186 ``` Note: The `userid`, `token`, and `club_id` fields are optional. If you don't have them, the tool can fetch them automatically using the mobile-login command (see below). To fetch the `token` and `club_id` using mobile-login: ```shell myice mobile-login ``` This will output the necessary information that you can add to your `myice.ini` file. ## fetch schedule ```shell myice schedule -o schedule.json ``` To use a specific configuration section: ```shell myice schedule -o schedule.json --config-section isaac ``` ## data ### listing To fetch events for U13 Elite for example: ```shell ❯ myice search "U13 (Elite)" [576653] 2024-11-04 practice 17:00-> 17:00 practice: Off-Ice Patinoire des Vernets - Patinoire Extérieure [572066] 2024-11-04 practice 18:00-> 18:00 practice: On-Ice Patinoire des Vernets - Patinoire Extérieure [576652] 2024-11-05 practice 18:00-> 18:00 practice: Off-Ice Patinoire des Vernets - Patinoire Extérieure [572068] 2024-11-05 practice 19:15-> 19:15 practice: On-Ice Patinoire des Vernets - Patinoire Extérieure [576655] 2024-11-08 practice 18:00-> 18:00 practice: Off-Ice Patinoire des Vernets - Patinoire Extérieure [572073] 2024-11-08 practice 19:15-> 19:15 practice: On-Ice Patinoire des Vernets - Patinoire Extérieure [117015] 2024-11-02 game 12:15-> 12:15 game: Saison HC Ajoie ``` And we retrieve the match roster: ### match To get the roster for the match against Ajoie, the ID is 117015: ```shell ❯ myice game 117015 Opening file game_117015.pdf ``` To use a specific configuration section: ```shell ❯ myice game 117015 --config-section isaac ``` ### practice And for a practice roster: ```shell ❯ myice practice 561855 Opening file practice_561855.pdf ``` To use a specific configuration section: ```shell ❯ myice practice 561855 --config-section isaac ``` ### AI ```text ❯ myice ai > prochain match u13 top ? < Le prochain match de l'équipe U13 Top se déroulera le dimanche 10 novembre 2024 contre HC Ajoie à la Raffeisen Arena de Porrentruy. Le match débutera à 14h00 et se terminera à 16h15. > et les u13 a ? < Le prochain match de l'équipe U13 A se déroulera le samedi 9 novembre 2024 contre HC Vallorbe à P. du Frézillon, 1337 Vallorbe VD. Le match débutera à 13h00 et se terminera à 15h00. Le prochain match à domicile de l'équipe U13 A se déroulera le dimanche 10 novembre 2024 contre CP Meyrin à Les Vernets, Glace extérieure, 1227 Les Acacias GE. Le match débutera à 13h00 et se terminera à 15h00. ``` To use a specific configuration section: ```shell ❯ myice ai --config-section isaac ```