Provides a set of utilities to simplify communication with robin-powered API and more easily automate bookings.
Project description
Robin Powered API Bot - RoBot
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.
Getting Started
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
Using RoBot
In order to use the package an API key has to be provided via the env variable ROBIN_AUTH_TOKEN.
User Info
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("dbarone@company.com", 11, 8, 10)]
Notes: Seat Id has still to be provided, haven't found yet a more user friendly way to do it.
Reserve
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("dbarone@company.com", 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.
Check in
Following an example of check in.
from datetime import datetime
from src.robin import Robin
from src.user import UserInfo
users_info = [UserInfo("dbarone@company.com", 11, 8, 10)]
r = Robin(users_info)
results = r.check_in(datetime(2022, 11, 24))
print(results)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file robin-powered-bot-0.0.8.tar.gz
.
File metadata
- Download URL: robin-powered-bot-0.0.8.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7eba1c27baa581f0d9bd3b20f33896a660aed4c0e1e22a4b5931115cc6cf56ff
|
|
MD5 |
9077e5bf5b88e8ac9bc7a679b42ab94a
|
|
BLAKE2b-256 |
b9374622c0bf241c134a2e831645ee8f193dec8e8adc2abd08c2ae6472509298
|
File details
Details for the file robin_powered_bot-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: robin_powered_bot-0.0.8-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5621868cf9da47a9485b440bc5709de7addd6e72fe69b1d8f4faf76eccddd054
|
|
MD5 |
1831b758aa75dc2339857652fce14b80
|
|
BLAKE2b-256 |
e987ac3c2c41497096846204505467ab1f71678264284475ccfd80e63c434451
|