GeoDataV2 is a Mapeador Multi-Bancos CDMX — a Python toolkit that extracts, maps, and analyzes bank branch locations across Mexico City for Santander, BBVA, and Banorte. It combines the Google Places API with Folium interactive maps and a Streamlit dashboard for review sentiment, competition metrics, and geographic insights.
What it does
The project has two main layers:
1. Data extractor (V1Extractor.py)
The MultiBankCDMXMapper class drives the pipeline:
- Multi-bank search — Queries Google Places for branch locations across all 16 CDMX boroughs (alcaldías), using configurable search strategies: by borough, by grid, or mixed (boroughs + postal codes).
- Deduplication — Tracks processed place IDs to avoid duplicate entries across overlapping searches.
- Rich place data — Captures name, address, phone, hours, ratings, review counts, and recent user reviews per branch.
- Competition analysis — Calculates distances between competing branches within a configurable radius (default 1 km), rating advantages, and zone-level dominance stats.
- Export — Saves results as JSON, CSV, and multi-sheet Excel (per-bank tabs, borough dominance, comparative summaries), plus standalone HTML maps.
2. Streamlit dashboard (streamlit_analyzer.py)
An interactive web app that loads the exported datasets and provides:
- Overview — Key metrics and bank distributions
- Review analysis — Sentiment classification (TextBlob), word clouds, and rating trends
- Competition — Market saturation, distance comparisons, and competitive advantages by zone
- Interactive maps — Folium layers embedded via
streamlit-folium, with per-bank toggles and heatmaps - Advanced insights — Correlations, predictive hints, and expansion recommendations
A launcher script (run_analyzer.py) checks for existing data files, optionally runs the extractor first, installs dependencies, and boots Streamlit.
Tech stack
| Layer | Choice |
|---|---|
| Language | Python 3 |
| Geodata API | Google Maps Places API |
| Maps | Folium + streamlit-folium |
| Dashboard | Streamlit |
| Visualization | Plotly, Matplotlib, Seaborn |
| NLP | TextBlob (sentiment), WordCloud |
| Data | Pandas, NumPy, openpyxl |
| Distance | Geopy (geodesic) |
Map features
Generated HTML maps include:
- Color-coded markers by bank (Santander red, BBVA blue, Banorte green) and by rating tier
- Popups with full branch details, recent reviews, and nearby competitor info
- Toggleable heatmap layers per bank
- Competition circles highlighting high-density zones
- Multiple basemap options (OpenStreetMap, dark/light modes)
Development process
Initial scaffold
The first commit established the core MultiBankCDMXMapper class in V1Extractor.py: Google Places integration, multi-bank configuration, borough-based search across all 16 alcaldías, grid search strategy, result processing with deduplication, Folium map generation with marker clusters and heatmaps, competition distance calculations, and JSON/CSV/Excel export. Sample output files and pre-built HTML maps were included in the repo.
Sequential commit
A follow-up commit refined the extraction pipeline — sequential processing improvements to handle API pagination, rate limiting pauses between borough searches, and more reliable result accumulation across the three banks.
Streamlit configuration
Added the Streamlit dashboard (streamlit_analyzer.py) with a dark-themed UI, per-bank styling, Plotly charts, Folium map embedding, and sidebar filters. Also added .streamlit/config.toml for deployment settings and run_analyzer.py as a one-command launcher.
README update
Expanded the README with full documentation: installation steps, API key setup, usage examples for each search strategy, descriptions of exported files and Excel sheets, map layer explanations, competition metrics, and customization options for adding new banks or changing competition radius.
Final version (Unix time)
Fixed timestamp handling across the pipeline — export filenames and metadata now use consistent Unix-time-based naming (multibancos_cdmx_YYYYMMDD_HHMM), ensuring sorted data files and correct datetime parsing in the Streamlit loader.
Streamlit build error fix
Resolved a Streamlit compilation/deployment error that blocked the hosted demo. After this commit the app deployed successfully to bankdata.streamlit.app.
Use cases
- Market research — Compare branch density and customer satisfaction across banks and boroughs
- Expansion planning — Identify underserved zones with low competition
- Competitive intelligence — See which branches outperform nearby rivals on ratings and review volume
- Academic / portfolio — Demonstrate end-to-end geodata extraction, analysis, and visualization


Building Smartclic Demo