Skip to content

Python script to pull attendance records of members from Online Scout Manager

License

Notifications You must be signed in to change notification settings

nimpo/getOSMAttendance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getOSMAttendance: getAttendence.py

Python script to pull attendance records of members from Online Scout Manager

Online Scout Manager provides a place to keep membership data.

This script was designed to authenticate to the Online Scout Manager site and download attendance data using the undocumented API.

To use this script you will need an API key via the service https://www.onlinescoutmanager.co.uk/main.php . (As the service uses XMLHTTPRequests to load most pages via JSON I cannot give you a permalink, AFAIK).

  1. Expand "Settings" (bottom of left pane)
  2. Select "My Account Details"
  3. From the new menu on the left in the main pane select "Developer Tools"
  4. Click Create Application button (top right)
  • This will give you a client_id and client_secret: keep these secret; keep these safe
  1. Register a Redirect URL for your application by clicking on the application name in the "My Applications" tab
  2. Put this URL and the application key and secret in a separate .env file alongside getAttendence.py
OSM_API_KEY=<put key here>
OSM_API_SECRET=<put secret here>
OSM_API_RETURL=<put OAuth2 Callback URI here>

Using the code

Once setup for OAuth2 authentication, to run this, first make sure it's executable

chmod u+x getAttendence.py

Then just run ./getAttendence.py and follow the instructions. A browser should pop up and ask you to log into OSM. Do this, and copy the redirect url from the browser's addreas bar into the terminal window when promped. (Or if you deploy the perl CGI script at the same location as the Redirect URL there should be a copy button you can use.)

NB

  • I use GNU/linux. This code was written and tested on such a device (Ubuntu 22.04 and KDE if you must know). It may (/should) work on Windows and Mac though I haven't tested on those OSes.
  • The code requires a browser for the OAuth2 handshake.

Licence

Copyright 2024 Mike Jones, [email protected] AKA Grey Wolf [email protected] AKA Akela [email protected] [23rd Manchester (Birch with Fallowfield)] Scout Membership number: 12114313

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Kudos

If you find this useful you can show your gratitude thusly:

About

Python script to pull attendance records of members from Online Scout Manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published