Mixxy3k/dps-explore

β˜… 0Forks 0HTMLGitHub β†—Compare

README

🏠 KRDO Explorer β€” Krajowy Rejestr DomΓ³w Opieki

Interactive data explorer for 3,475+ care facilities across Poland.
A solo full-stack data project: web scraping β†’ geocoding pipeline β†’ interactive SPA.


πŸ“Œ Overview

KRDO Explorer is a client-side single-page application that lets users browse, filter, sort, and save care homes from Poland's National Register of Care Facilities (KRDO). Built for a real-world need β€” helping a family member find an appropriate long-term care placement.

Live demo: β†’ https://mixxy3k.github.io/dps-explore/


✨ Features

Feature Detail
πŸ” Full-text search Search by name, location, address, or care type
🎯 One-click presets "Intellectually disabled", "Public only", "KIDO recommended", "Nearby (50 km)"
πŸ“ Distance calculation Haversine formula β€” enter any city, default ElblΔ…g
⭐ Favorites basket Persisted in localStorage, survives page refreshes
πŸ“± Responsive design Card layout on mobile, table view on desktop (auto-switch at 900px)
πŸ—ΊοΈ Geo-enriched All 405 unique locations geocoded via OpenStreetMap Nominatim
πŸ“Š Live statistics Real-time counts: total places, public/private split, recommended badges

πŸ› οΈ Tech Stack

Layer Technology
Frontend Vanilla HTML/CSS/JS β€” zero dependencies, one file
CSV parsing PapaParse (CDN)
Geocoding OpenStreetMap Nominatim API + Python batch script
Distance Haversine formula (client-side)
Persistence Browser localStorage for favorites
Data source krdo.pl β€” scraped with Python + BeautifulSoup
Deployment GitHub Pages

πŸ“ Repository Structure

β”œβ”€β”€ index.html                 # Main application (SPA)
β”œβ”€β”€ krdo_dps_poland.csv        # Full dataset (3,475 records)
β”œβ”€β”€ locations_geo.json         # Pre-geocoded coordinates (405 locations)
β”œβ”€β”€ scrape_krdo.py             # Web scraper (Python + BeautifulSoup)
β”œβ”€β”€ geocode_locations.py       # Geocoding pipeline (Python + Nominatim)
β”œβ”€β”€ explore.py                 # Data analysis script
└── README.md

πŸ”§ Data Pipeline

krdo.pl (website)
    ↓  scrape_krdo.py (requests + BeautifulSoup, 387 pages, 1.5s delay)
krdo_dps_poland.csv (3,475 records, 714 KB)
    ↓  geocode_locations.py (Nominatim API, 1.1s/req, 405 unique locations)
locations_geo.json (405 geocoded locations, 100% success rate)
    ↓  index.html loads both files
Interactive web app
  • Scraper: Paginates through all 387 pages with polite delays, parses HTML tables, extracts badges (KIDO recommendations), and saves UTF-8-BOM CSV for Excel compatibility.
  • Geocoding: Extracts 405 unique location strings (powiats, cities), geocodes via OpenStreetMap with smart query fallback, caches to JSON, periodic saves every 20 locations.
  • App: Loads CSV via File API + PapaParse, loads geo JSON via fetch, computes Haversine distances on-the-fly.

πŸš€ Getting Started

Local development

python -m http.server 8080
# Open http://localhost:8080
# Click "Wybierz plik" and load krdo_dps_poland.csv

Production (GitHub Pages)

  1. Push this repo to GitHub
  2. Settings β†’ Pages β†’ deploy from main branch / (root)
  3. Done β€” fully client-side, no backend needed

πŸ“Š Dataset Stats

Metric Value
Total facilities 3,475
Total bed capacity ~192,600
Public facilities 919
Private facilities 818
KIDO Recommended 318
Intellectually disabled 253

πŸ“„ License

Data sourced from Krajowy Rejestr DomΓ³w Opieki (KRDO).
This project is for educational and personal use.


Built with ❀️ for Babcia

Contributors

Mixxy3k

Issues