Reserves rooms at NTNU by user-selected criterias following a prioritized list.
(spaghetti level code)
Runs python3 using the following libraries:
-
requests
-
lxml
-
numpy
-
pandas
- Make sure you have python setup with the correct libraries.
- Create env variable "FUSER" with feide-username
- Create env variable "FPASSWORD" with feide-password
- Run
python3 roomreserver.py init=True
- In the newly created
buildings.csv
rank what buildings you want to choose from. HIGHER IS BETTER. 0 will be ignored. - In the newly created
roomtypes.csv
rank what buildings you want to choose from. HIGHER IS BETTER. 0 will be ignored. - In the newly created
areas.csv
rank what buildings you want to choose from. HIGHER IS BETTER. 0 will be ignored. - If you want to rank rooms before reserving run
python3 roomreserver.py start="HH:MM" duration="HH:MM" min_size="XX" reserve=F
and edit ranks in the newly createdroom_priority.csv
.
python3 roomreserver.py start="HH:MM" desc="Reservation description HERE" duration="HH:MM" min_size="XX"
By default:
duration="02:00" min_size="10"
Rooms with negative rank will be ignored. Rooms without rank will by default be set to rank 0
To run without reserving rooms and only search for new rooms at selected filters:
reserve=False
Arguments:
Parameter | Description | Default value | Format |
---|---|---|---|
init | Is script in initialize state. E.g. needs to search rooms and create necessary .csv files | False | "T" or "F" |
reserve | If not init, should post reserve requests? | True | "T" or "F" |
store | Store new rooms found in .csv? (Will make script somewhat slower) | True | "T" or "F" |
duration | Length of reservation | 02:00 | "HR:MM" |
min_size | Minimum size of room (number of people) | 10 | Int |
reserve_in | Days into the future for when to reserve | 14 | Int |
start | Start time of reservation (Not needed when init) | "HR:MM" | |
desc | Description of reservation (Not needed when init) | "YOUR DESCRIPTION" | |
slack_log | Log to slack, needs SLACK_URL, SLACK_TOKEN and SLACK_CHANNEL | F |
This script was updated in October 2020 on https://tp.uio.no/ntnu/rombestilling/. Might not work in the future :(