Many companies are nowadays using the Robin platform to connect employees with desks, rooms and each other.
Robin Powered API Bot (RoBot) is a package that tries to simplify the life of employees that are not allowed to have permanent desks anymore. All that is necessary are email and seatid.
Assuming that you have a supported version of Python installed, you can first set up your environment with:
$ python -m venv .venv
...
$ . .venv/bin/activate
Then you can install robin-powered-bot
python -m pip install robin-powered-bot
In order to use the package an API key has to be provided via the env variable ROBIN_AUTH_TOKEN.
UserInfo is used to load and store all info about the user, it needs the following parameters:
- email: employee email;
- stime: start time of the working day as it would be specified in Robin;
- duration: how long is your working day, usually 8 hours;
- sid: seat id, identifier of the seat that you want to book.
from src.user import UserInfo
users_info = [UserInfo("[email protected]", 11, 8, 10)]
Notes: Seat Id has still to be provided, haven't found yet a more user friendly way to do it.
Following an example to book a desk for 5 days, from the 15th to the 20th.
from datetime import datetime
from src.robin import Robin
from src.user import UserInfo
users_info = [UserInfo("[email protected]", 11, 8, 10)]
r = Robin(users_info)
results = r.reserve(datetime(2022, 11, 15), datetime(2022, 11, 20))
print(results)
Notes:
The reserve method will do the following:
- Reserve all working days;
- Skip all weekends, it doesn't deal with holidays;
- Companies might enforce a limit on how much in advance a desk can be booked, the reserve method will just stop.
Following an example of check in.
from datetime import datetime
from src.robin import Robin
from src.user import UserInfo
users_info = [UserInfo("[email protected]", 11, 8, 10)]
r = Robin(users_info)
results = r.check_in(datetime(2022, 11, 24))
print(results)