Skip to main content

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

execute the login function once to create browser_profile that is logged into airbnb

cd ~/aibnbclean
./.venv/python -c "import aibnbclean; aibnbclean.login()"

run daily using cron

the following example runs at 1:30pm daily

30 13 * * * date > /tmp/aibnbclean.log
30 13 * * * cd $HOME/aibnbclean; ./.venv/python -c "import aibnbclean; aibnbclean.process()" >> /tmp/aibnbclean.log 2>&1

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

aibnbclean-2.1.0.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aibnbclean-2.1.0.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file aibnbclean-2.1.0.0.tar.gz.

File metadata

  • Download URL: aibnbclean-2.1.0.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for aibnbclean-2.1.0.0.tar.gz
Algorithm Hash digest
SHA256 c3a955e71e8e74fb0d5600a84ce2b3f52d02111eeeb342d67523959575adb589
MD5 bdb32fb8ffbb5d27a3ecf6273ba80910
BLAKE2b-256 5ce17a96f98af60a528ec46241e1c5070b29b94818286a8e9228bd4022bc6193

See more details on using hashes here.

File details

Details for the file aibnbclean-2.1.0.0-py3-none-any.whl.

File metadata

  • Download URL: aibnbclean-2.1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for aibnbclean-2.1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 009e2f337ff88de58a72e376ee4adf8e7667c73681f16d085ea9e86200d608d6
MD5 a7fa1e7f6e298a3d904956e8595f1ba6
BLAKE2b-256 f5696a999e6e0f6dfa7c8a12b73fbbc44eab0d96fa4eff3aa49587a133ed5db6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page