Live demo (desktop/laptop recommended): https://property.stephendaly.dev
This demo runs the CLI in a browser-based terminal with a fixed 80×24 layout. On mobile, the terminal width is very constrained, so the experience can feel cramped and may require zoom/scroll.
A Python Command-Line Interface (CLI) app that reads Irish new-house price data from Google Sheets, lets you select a year/quarter range and region, and produces clear, terminal-friendly summary statistics.
This repo also includes a small Node.js wrapper that runs the Python CLI inside a browser terminal (useful for Heroku-style deployments).
- API integration: Google Sheets Application Programming Interface (API) access using a service account
- Data processing: parsing values, selecting ranges, calculating descriptive stats
- Defensive programming: validation, clear error messages, and “fail fast” configuration checks
- Export tooling: write analysis results to TXT and Comma-Separated Values (CSV) files (local runs)
- Deployment-aware design: browser terminal wrapper with fixed 80×24 output constraints
- Automation: Continuous Integration (CI) checks via GitHub Actions, including Python syntax checks,
rufflinting, corepytesttests, and a basic Node wrapper smoke check
- Reads the most recent year/quarter in the sheet
- Prompts you for the next quarter’s values
- Appends a new row to Google Sheets
Pick:
- start year + quarter
- end year + quarter
- region (Nationally, Dublin, Cork, Galway, Limerick, Waterford, Other counties)
Outputs (terminal-friendly):
- overall % change (start → end)
- mean and standard deviation
- min, max, range
- quartiles (Q1/median/Q3) and Interquartile Range (IQR)
If you choose “yes” when prompted, the app writes:
analysis_results.txt(append-only)analysis_<start>_<end>_<region>.csv
Note: on ephemeral hosts (e.g., Heroku), file writes may not persist between restarts.
- Python:
gspread,google-auth,numpy,statistics,pytest - Node.js (demo wrapper):
total4,node-pty,xterm.js(via CDN) - CI / quality: GitHub Actions,
ruff,pytest
run.py— main Python CLI programrequirements.txt— Python runtime dependenciesrequirements-dev.txt— Python development dependencies (ruff+ runtime deps)pyproject.toml—ruffconfigurationindex.js,controllers/default.js,views/— browser terminal wrapper.github/workflows/ci.yml— CI checks (syntax,ruff, corepytest, Node smoke)tests/test_run.py— core pytest coverage for helper functions.devcontainer/— optional devcontainer configuration (renamed from inherited template defaults)
The first worksheet/tab must contain a header row with exact column names:
Year | Quarter | Nationally | Dublin | Cork | Galway | Limerick | Waterford | Other_counties
The app uses worksheet.get_all_records() so header names must match exactly (including Other_counties).
macOS / Linux:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtWindows PowerShell:
py -m venv .venv
.venv\Scripts\Activate.ps1
py -m pip install -r requirements.txtIn Google Cloud Console:
- Create a Google Cloud project
- Enable Google Sheets API
- Create a Service Account
- Create/download a JSON key
Store the key outside the repo (recommended):
mkdir -p ~/.secrets
mv /path/to/service-account.json ~/.secrets/property-tracker-creds.json- Create a Google Sheet with the required header row (see above)
- Share the sheet with the service account email (
client_emailinside the JSON) as Editor - Copy the spreadsheet ID from the URL:
https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/edit
export PT_CREDS_PATH="$HOME/.secrets/property-tracker-creds.json"
export PT_SPREADSHEET_ID="<YOUR_SPREADSHEET_ID>"
python3 run.pyThis runs a small Node server that spawns python3 run.py in an 80×24 terminal.
npm installexport PORT=8000
export PT_CREDS_PATH="$HOME/.secrets/property-tracker-creds.json"
export PT_SPREADSHEET_ID="<YOUR_SPREADSHEET_ID>"npm startOpen in your browser:
http://localhost:8000
This repo’s Node wrapper supports a typical “browser terminal” deployment model.
PORT— set automatically by the hosting platform in deployment; use8000for local runs if neededPT_SPREADSHEET_ID= your Google Sheet IDCREDS= the full contents of your service-account JSON (paste as a single config var)PT_CREDS_PATH=creds.json
Why PT_CREDS_PATH=creds.json?
controllers/default.jswritescreds.jsonat runtime fromCREDSrun.pyreads credentials fromPT_CREDS_PATH
Security note: treat the service account key like a password. Don’t commit it to GitHub. Rotate it if exposed.
GitHub Actions runs checks on push/pull request:
- Python syntax compilation (
py_compile,compileall) rufflinting- Core
pytesttests for helper functions - Node install + basic require check
Workflow file: .github/workflows/ci.yml
This project is currently maintained as a portfolio/demo repository.
The current release focuses on a stable CLI workflow, core automated checks, and practical CI quality gates.
- Browser deployments may not retain exported files between restarts (ephemeral filesystem)
- Data coverage depends on what’s present in the linked Google Sheet
- The live demo is best on desktop/laptop due to fixed terminal dimensions
- Central Statistics Office (CSO) Ireland / data.gov.ie — “Price of New Property by Quarter”