airbnb cleaning notification automation tool
Project description
aibnbclean
the following is some basic code that helps automate cleaning scheduling and communication for short-term rental properties such as Airbnb listings
- it pulls booking data from airbnb calendars or google calendars
- it uses google spreadsheets to track cleaning schedules and records
- it uses playwright for web scraping and google gemini api to parse user messages for cleaning info
- it sends text message reminders about upcoming cleaning dates via twilio
- it sends cleaner payment tasks to todoist
Developer setup local machine windows
initial setup
# install python
winget install python
# install uv package manager
pip install uv
# clone this repo
git clone <repo url>
# cd to the code repo folder
cd <code repo folder>
# create a virtual environment and install dependencies from pyproject.toml
uv sync
.env file
create an .env file at the base of the code repo folder with the following content:
AIBNBCLEAN_CONFIG_DIR="C:/path/to/config/dir"
AIBNBCLEAN_HEADLESS="1"
AIBNBCLEAN_GEMINI_MODEL="gemini-flash-latest"
listings.json
create listings.json in the config directory specified in the .env file
[
{
"name": "403M St NW Lower",
"type": "airbnb",
"laundry": "yes",
"url": "https://www.airbnb.com/calendar/ical/xxxxxxxx.ics?s=yyyyyyy",
"spreadsheet_id": "google_spreadsheet_id",
"spreadsheet_sheet_name": "Sheet1",
"spreadsheet_sheet_id": 0,
"spreadsheet_bitly_url": "bitly_url_to_spreadsheet",
"default_cleaning_fee": 140,
"qty_to_process": 10,
"guests": {
"min": 1,
"max": 4
},
"beds": {
"min": 1,
"max": 2
},
"pnp_beds": {
"min": 0,
"max": 1
},
"days_addrm_notice": 14,
"todoist_project_name": "airbnb"
}
]
secrets.json
create listings.json in the config directory specified in the .env file
{
"gemini_api_key": "api_key",
"todoist_api_key": "api_key",
"twilio": {
"client": "clientid:clientsecret",
"from_number": "+18005551212",
"to_number": "+18005562323"
},
"google_sa": {
"type": "service_account",
"project_id": "google-cloud-project-id",
"private_key_id": "private_key_id",
"private_key": "private_key_contents",
"client_email": "client@project.iam.gserviceaccount.com",
"client_id": "clientid",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/client%40project.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
}
Production setup on raspberry pi with gui interface
sudo adduser airbnb
sudo usermod -aG adm,dialout,cdrom,sudo,audio,video,render,plugdev,games,users,input,netdev,spi,i2c,gpio,lpadmin airbnb
config
define config directory, listings.json, secrets.json, .env file similar to developer setup above
initial install
# install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh
# cd to config directory
cd ~/aibnbclean
# create and activate the venv
uv venv
source .venv/bin/activate
# install aibnbclean package into the venv
uv pip install --refresh aibnbclean
# install playwright
playwright install --with-deps
# execute the login function once to create browser_profile with access to airbnb
python -c "import aibnbclean; aibnbclean.login()"
# once logged in you should be able to do a test run
python -c "import aibnbclean; aibnbclean.process()"
run daily using cron
the following example runs at 1:30pm daily
30 13 * * * date > /tmp/aibnbclean.log
30 13 * * * cd $HOME/aibnbclean && $HOME/aibnbclean/.venv/bin/python -c "import aibnbclean; aibnbclean.process()" >> /tmp/aibnbclean.log 2>&1
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aibnbclean-2.4.0.0.tar.gz.
File metadata
- Download URL: aibnbclean-2.4.0.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f62ba1f6737ab96f26d19edb2037f3d31f0b7fc6cb4665800c160d6e6c4abd75
|
|
| MD5 |
f681809094fca7e5db1698f8b7e61636
|
|
| BLAKE2b-256 |
3646887a14c243a72888e81139004493c22902955ca23ee3a3a996c57a687ddb
|
File details
Details for the file aibnbclean-2.4.0.0-py3-none-any.whl.
File metadata
- Download URL: aibnbclean-2.4.0.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
799a6dcb1f4d9b69ca1ddd500498b7963ee131b454f717a7671a9b299bb736be
|
|
| MD5 |
e15f4d675d2c79cd42368cd1672e410f
|
|
| BLAKE2b-256 |
de00c811301aa4a1fb8ab7830fd1d3cdc4db379683db75580d1b5472099651c6
|