Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Centara Resorts — Stand-Alone tool for PDF Availability Extraction

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.

Supported Resorts

Resort Status
Centara Ras Fushi Resort & Spa, Maldives ✅ Active
Centara Mirage Lagoon Maldives ✅ Active
More properties 🔜 Coming soon

How It Works

  1. Staff receives PDF availability calendars from Centara via email
  2. PDFs are dropped into this folder
  3. The script auto-identifies which resort each PDF belongs to (by filename)
  4. Parses the availability table (Free Sale / Stop Sale / On Request per room per day)
  5. Updates the corresponding packages in MongoDB

Quick Start

First Time Setup

  1. Install Python 3.10+
  2. Clone this repo
  3. Double-click SETUP.bat (installs dependencies)
  4. Create a .env file from .env.example with your MongoDB connection string

Usage

Option A — Manual upload (recommended for most staff):

  1. Drop Centara PDF files into this folder
  2. Double-click UPLOAD.bat

Option B — Auto-watcher (hands-free):

  1. Double-click WATCH.bat (runs in background)
  2. 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"

PDF Format Support

The parser handles Centara's standard availability calendar formats:

  • Ras Fushi style: Month headers like May-26, date columns like 1-May, 2-May
  • Mirage Lagoon style: Month headers like May 2026, date columns as plain numbers 1, 2, 3...

Status codes recognized: FS (Free Sale), SS (Stop Sale), OR (On Request), SS-N, OR-N, O (Re-opened)

Adding New Centara Resorts

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).

Environment Variables

Variable Description
MONGO_URI MongoDB connection string
MONGO_DB Database name (default: ResortsTestDB)
MONGO_COLLECTION Collection name (default: resorts_master)

Requirements

  • Python 3.10+
  • MongoDB instance
  • PDF files from Centara Resorts reservations team

About

PDF availability calendar parser for Centara Resorts (Maldives). Extracts room availability (Free Sale / Stop Sale / On Request) from Centara's PDF calendars and syncs to LuxuryIslandGetaway's MongoDB. Drop PDFs, double-click to upload.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages