Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #6 from muffix/support-variants
Browse files Browse the repository at this point in the history
The BayIMCO API has changed and now requires the vaccination number
(first, second or boost) to find available appointments. In the case of
a second jab, it also requires the variant used for the first one.

This change updates the checker to support that.

Additionally, filtering for vaccines targeting a specific variant is now
supported.
  • Loading branch information
muffix authored Oct 4, 2022
2 parents 32f2b38 + dece9cc commit c61a0de
Show file tree
Hide file tree
Showing 8 changed files with 507 additions and 346 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.11b1
rev: 22.8.0
hooks:
- id: black
name: Black
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Changelog

## UNRELEASED
## v1.1.0

- Added support for the updated BayIMCO API
- Added filter to find vaccination appointments against a specific variant, such as BA.1 or BA.4/5
- Added support for the `--debug` option to additionally print debug output

## v1.0.3
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM python:3.9-slim
FROM python:3.10-slim

WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

COPY impf.py impf.py
COPY byimpf byimpf

ENTRYPOINT ["python", "impf.py"]
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ pip install -r requirements.txt
### Run the checker

The checker requires your username, password, and citizen ID.
You can find your citizen ID if you login to the portal and select the person.
You can find your citizen ID if you log in to the portal and select the person.
The address bar in your browser contains the ID in the following format:
`https://impfzentren.bayern/citizen/overview/{CITIZEN_ID}`.

By default, it searches for the earliest available appointment for a boost dose with
any available vaccine. You can customise this with the options described below.

Minimal example to find the next available appointment:

```shell
Expand All @@ -47,7 +50,7 @@ usage: impf.py [-h] --citizen-id CITIZEN_ID --email EMAIL --password PASSWORD [-
Appointment checker and booker for Bavarian vaccination centres
optional arguments:
options:
-h, --help show this help message and exit
--citizen-id CITIZEN_ID
Your citizen ID. Find it in the address bar of your browser after selecting the person in the web portal.
Expand All @@ -59,8 +62,31 @@ optional arguments:
The latest acceptable day for an appointment, in ISO format (YYYY-MM-DD)
--interval INTERVAL The interval in seconds between checks. If not passed, only one check is made.
--book, --no-book Whether to book the appointment if found (default: False)
--debug Whether to print debug log output
--dose DOSE Which vaccination to looking for: first, second or boost. Defaults to boost.
--first-vaccine-id FIRST_VACCINE_ID
The ID of the vaccine that was used for the first jab. Only required for the second vaccination.
--variant VARIANT Variants to find vaccines for; either ba1 or ba45. Leave blank for any.
```

#### Vaccine IDs

If you're looking for an appointment for the second vaccination, you need to specify the vaccine that was used for the
first jab. In addition to `--dose=second`, add `--first-vaccine-id` according to the following table. E.g.,
`--first-vaccine-id=002` if the first jab was BioNTech/Pfizer.

| Vaccine | ID |
|-----------------------------------------------------|:---:|
| Vaxzevria/AstraZeneca | 001 |
| Comirnaty (BioN-Tech/Pfizer) | 002 |
| Moderna COVID19 Vaccine | 003 |
| COVID-19 Vaccine Janssen | 005 |
| Nuvaxovid | 006 |
| Valneva | 008 |
| Comirnaty Original/Omicron BA.1 (BioNTech/Pfizer) | 009 |
| Spikevax 0 (Zero)/O (Omicron) (Moderna) | 010 |
| Comirnaty Original/Omicron BA.4-5 (BioNTech/Pfizer) | 011 |

#### Checking until successful

You can use the optional `--interval` option to tell the script to keep trying until it succeeds in finding (or booking
Expand Down
Empty file added byimpf/__init__.py
Empty file.
Loading

0 comments on commit c61a0de

Please sign in to comment.