qrcode package: pip install requests qrcode.
The scanner can be any barcode scanner that types what it reads, the way a keyboard does. Most USB and Bluetooth scanners work like this, and so do “scan to keyboard” apps on a phone or tablet.
1. Print the cards
This script writescards.html: one card for each young person in a section, with their name and a QR code. Open it in a browser and print it on card.
cards.py
2. Run the kiosk
This script asks which of today’s meetings to take the register for, then waits for scans. It sends them to Scoutworks in batches: when 20 are waiting, or with the next scan once 15 seconds have passed. Press Enter on its own to send what is waiting. A slow connection never holds up the queue at the door. A scan that cannot be sent waits incheckin-queue.json and goes with the next batch, even if the script is stopped and started again.
kiosk.py
3. Use your own key
The sandbox key is read-only, so the kiosk needs your own key. A group admin creates one in Settings → Integrations → API keys, with these scopes:members:read, to print the cards;events:read, to find tonight’s meeting;attendance:readandattendance:write, to mark the register.
api-demo.scoutworks.app to api.scoutworks.app in cards.py, and set your key in the environment. read -s asks for it without showing it:
Notes
- Only present. The kiosk marks who came. Mark anyone who did not come as absent in Scoutworks, or send
"attendance": "absent"for them. - Scanning twice is fine. The same scan again answers
unchanged. A batch counts as one write against the limit of 30 a minute, so a queue of arrivals never reaches it. See Writing data. - Families are not told. A mark never emails or notifies a parent, and never changes their reply to the event.
- Joint events. A young person from another group is refused: each group marks its own. A meeting that is full refuses a walk-in, because the kiosk cannot ask a leader to confirm. Mark that young person in Scoutworks, which can go over the limit.
- A webhook. If your group has a webhook for
attendance.recorded, each batch sends one event for the register, not one for each young person.