Uses the Google Places API to get information about on campus buildings
This repository collects and organizes real-time place data (e.g., Starbucks, Tim Hortons, campus cafés) using the Google Places API.
It is part of the UBC LIVE project, which supports lineup prediction, campus flow analysis, and real-time operational insights.
- Fetches Google Places API data for selected UBC campus locations
- Stores raw API responses in
/data/raw/ - Cleans and standardizes data into
/data/clean/ - Contains ingestion scripts in
/scripts/ - Stores documentation in
/docs/
## 📁 Folder Layout
scripts/ # Python scripts for ingestion
data/
raw/ # Raw API responses
clean/ # Cleaned datasets
docs/ # Documentation and notes
.env.example # Template for environment variables
requirements.txt # Python dependencies
.gitignore # Ignore rules (env files, data folders, cache)Follow the steps below to set up the environment.
- Verify Python version
python --version- Clone the repository
git clone https://github.com/UBC-Live/Google-Places.git
cd Google-Places- Create a virtual environment
macOS / Linux
python3 -m venv .venv
source .venv/bin/activateWindows (PowerShell)
python -m venv .venv
.\.venv\Scripts\Activate.ps1- Install dependencies
pip install -r requirements.txt- Add your environment variables
Create a .env file in the project root (or copy .env.example):
GOOGLE_PLACES_API_KEY=your_key_here
{
"results": [
{
"place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4",
"name": "Starbucks",
"formatted_address": "6133 University Blvd, Vancouver, BC",
"geometry": {
"location": {
"lat": 49.2668,
"lng": -123.2550
}
},
"rating": 4.2,
"user_ratings_total": 133,
"business_status": "OPERATIONAL",
"opening_hours": {
"open_now": true
},
"types": [
"cafe",
"store",
"point_of_interest",
"food",
"establishment"
]
}
],
"status": "OK"
}
Ingestion scripts in /scripts/ call the Google Places API.
Full API responses are saved in /data/raw/ with timestamps.
Cleaning scripts transform and standardize the data.
Cleaned datasets are stored in /data/clean/.
Documentation (API notes, schema, etc.) is stored in /docs/.