This project identifies HDB flats in Singapore that were completed in 2021, which means they will reach their 5-year Minimum Occupancy Period (MOP) in 2026.
It bridges a gap found in this article from The Straits Times:
Over 13,400 HDB flats to reach MOP in 2026; analysts say supply could moderate resale price growth
While the article breaks down the number of flats by town, it does not provide a breakdown by HDB project name / estate. 👉 This project provides that missing granularity.
A dataset named:
data/hdb-property-info-with-name-2026.csv
Each row represents a block that meets ALL of the following criteria:
✔ Completed in 2021 ✔ Classified as residential ✔ Contains 2-room, 3-room, 4-room and/or 5-room units ✔ Mapped to its HDB project / estate name
If you don’t want to run the scripts — simply download this CSV from the data/ folder. There are also data available for HDB flats to MOP in year 2027 and 2028.
This project combines three public datasets / APIs:
| Purpose | Source |
|---|---|
| Block-level property details (year completed, flat types, town, etc.) | HDB Property Information — data.gov.sg |
| Project-level geometry polygons & project names | HDB Public Housing Building Under-Construction — data.gov.sg |
| Convert block address to latitude/longitude | OneMap Singapore API |
We query the dataset for blocks that:
- were completed in 2021
- are residential
- have 2-room, 3-room, 4-room and/or 5-room units sold
We also fetch the town metadata mapping and geocode each block address to lat/lon using OneMap.
Implementation: utils.py
We retrieve polygons representing public housing projects and map:
Project Name → Polygon Coordinates
Implementation: utils.py
Using Shapely geometry checks, each block’s lat/lon point is tested to see which HDB project polygon contains it, and the HDB project name is assigned.
Implementation: main.py
The resulting file is:
data/hdb-property-info-with-name-2026.csv
.
├── main.py
├── utils.py
├── data/
│ ├── hdb-property-info-mop-2026.csv
│ ├── hdb_name_to_coords.json
│ └── hdb-property-info-with-name-2026.csv 👈 Final dataset
├── .env 👈 Your OneMap credentials
├── requirements.txt
└── README.md
git clone <repo-url>
cd <repo-folder>pip install -r requirements.txt(Ensure shapely, pandas, requests, and python-dotenv are included.)
Create a .env file:
ONEMAP_EMAIL=your_email@example.com
ONEMAP_EMAIL_PASSWORD=your_password
python main.pyThis will:
- Download required datasets (only if not already present)
- Geocode HDB block addresses
- Match HDB blocks to HDB project polygons
- Produce the final CSV
By default, the script processes HDB blocks that will reach MOP in 2026.
You can override this using the optional --year flag:
python main.py --year 2027| Column | Meaning |
|---|---|
| blk_no | Block number |
| street | Street name |
| year_completed | Year HDB block completed |
| area | HDB town |
| 2room_sold / 3room_sold / 4room_sold / 5room_sold | Units sold |
| address | Combined address |
| lat / lon | Geocoded coordinates |
| name | HDB project / estate name |
- OneMap geocoding returns the closest match, so edge cases may mis-map
- A block must fall inside one and only one project polygon
- Only 2021 completion year is included
- Only 2-room, 3-room, 4-room & 5-room residential flats are considered
- There may be some HDB project names that could not be found in the dataset (I have manually filled in the data).
Data is sourced from:
- Housing & Development Board. (2018). HDB Property Information (2025) [Dataset]. data.gov.sg. Retrieved December 28, 2025 from https://data.gov.sg/datasets/d_17f5382f26140b1fdae0ba2ef6239d2f/view
- Housing & Development Board. (2023). HDB Public Housing Building Under-Construction (2025) [Dataset]. data.gov.sg. Retrieved December 28, 2025 from https://data.gov.sg/datasets/d_930e662ac7e141fe3fd2a6efa5216902/view
- OneMap Singapore API from https://www.onemap.gov.sg/apidocs/
All data belongs to their respective owners.
Note on AI Use This project contains content generated with the help of ChatGPT, including code scaffolding and documentation. The author has manually tested and validated the outputs where possible, but users should independently verify results before relying on them.
