Parses PDF availability calendars from Centara Resorts and uploads room availability data to MongoDB. Designed for LIG staff and partners who receive periodic PDF updates from Centara's reservations team.
| Resort | Status |
|---|---|
| Centara Ras Fushi Resort & Spa, Maldives | ✅ Active |
| Centara Mirage Lagoon Maldives | ✅ Active |
| More properties | 🔜 Coming soon |
- Staff receives PDF availability calendars from Centara via email
- PDFs are dropped into this folder
- The script auto-identifies which resort each PDF belongs to (by filename)
- Parses the availability table (Free Sale / Stop Sale / On Request per room per day)
- Updates the corresponding packages in MongoDB
- Install Python 3.10+
- Clone this repo
- Double-click
SETUP.bat(installs dependencies) - Create a
.envfile from.env.examplewith your MongoDB connection string
Option A — Manual upload (recommended for most staff):
- Drop Centara PDF files into this folder
- Double-click
UPLOAD.bat
Option B — Auto-watcher (hands-free):
- Double-click
WATCH.bat(runs in background) - Drop/replace PDFs anytime — changes are detected automatically
Option C — Command line:
# Process all PDFs in folder
python extract_availability.py --auto
# Watch for changes continuously
python extract_availability.py --watch
# Process a single file
python extract_availability.py --file "path/to/calendar.pdf"The parser handles Centara's standard availability calendar formats:
- Ras Fushi style: Month headers like
May-26, date columns like1-May,2-May - Mirage Lagoon style: Month headers like
May 2026, date columns as plain numbers1, 2, 3...
Status codes recognized: FS (Free Sale), SS (Stop Sale), OR (On Request), SS-N, OR-N, O (Re-opened)
Edit the RESORTS dictionary in extract_availability.py:
"resort_keyword": {
"name": "Full Resort Name",
"search_keywords": ["DB search term"],
"rooms": {
"PDF Room Name": "Database Room Name",
},
},The resort_keyword is matched against the PDF filename (case-insensitive).
| Variable | Description |
|---|---|
MONGO_URI |
MongoDB connection string |
MONGO_DB |
Database name (default: ResortsTestDB) |
MONGO_COLLECTION |
Collection name (default: resorts_master) |
- Python 3.10+
- MongoDB instance
- PDF files from Centara Resorts reservations team