waze-logs 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,411 @@
1
+ Metadata-Version: 2.4
2
+ Name: waze-logs
3
+ Version: 1.0.0
4
+ Summary: Worldwide Waze traffic event collection and analysis tool - demonstrates location privacy risks in crowdsourced traffic applications
5
+ Author-email: jasperan <jasperan@users.noreply.github.com>
6
+ Maintainer-email: jasperan <jasperan@users.noreply.github.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/jasperan/waze-logs
9
+ Project-URL: Repository, https://github.com/jasperan/waze-logs
10
+ Project-URL: Issues, https://github.com/jasperan/waze-logs/issues
11
+ Keywords: waze,traffic,privacy,osint,geolocation,security-research,data-collection
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Security
23
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: click>=8.0
28
+ Requires-Dist: requests>=2.28
29
+ Requires-Dist: pyyaml>=6.0
30
+ Requires-Dist: tabulate>=0.9
31
+ Requires-Dist: flask>=2.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=7.0; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ # Waze Worldwide Logger
37
+
38
+ [![PyPI version](https://badge.fury.io/py/waze-logger.svg)](https://badge.fury.io/py/waze-logger)
39
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
41
+ [![GitHub](https://img.shields.io/badge/GitHub-jasperan-181717?logo=github)](https://github.com/jasperan/waze-logs)
42
+ [![Flask](https://img.shields.io/badge/Flask-Web_UI-000000?logo=flask)](https://flask.palletsprojects.com/)
43
+ [![SQLite](https://img.shields.io/badge/SQLite-Database-003B57?logo=sqlite)](https://www.sqlite.org/)
44
+ [![Leaflet](https://img.shields.io/badge/Leaflet-Maps-199900?logo=leaflet)](https://leafletjs.com/)
45
+
46
+ A worldwide data collection and analysis tool for Waze traffic events. Demonstrates location privacy risks in crowdsourced traffic applications.
47
+
48
+ ## Overview
49
+
50
+ This tool captures Waze traffic reports (police, jams, hazards, accidents, road closures) from **5 continents** with:
51
+ - **Username** of the reporter
52
+ - **GPS coordinates** (latitude/longitude)
53
+ - **Timestamp** (millisecond precision)
54
+ - **Report type** and subtype
55
+ - **Region and city** information
56
+
57
+ By collecting this data over time, it's possible to build detailed movement profiles of individual users - demonstrating significant privacy implications of Waze's crowdsourced model.
58
+
59
+ **Coverage:** 8,656 grid cells across Europe, Americas, Asia, Oceania, and Africa
60
+
61
+ **Based on research by [Covert Labs](https://x.com/harrris0n/status/2014197314571952167)**
62
+
63
+ ## Quick Start
64
+
65
+ ### Prerequisites
66
+
67
+ - Python 3.10+
68
+ - ~500MB disk space (for worldwide data)
69
+
70
+ ### 1. Clone and install
71
+
72
+ ```bash
73
+ git clone <repo-url>
74
+ cd waze-madrid-logger
75
+ pip install -e .
76
+ ```
77
+
78
+ This installs the `waze` command globally.
79
+
80
+ ### 2. Start collector with web UI (recommended)
81
+
82
+ ```bash
83
+ # Start worldwide collector + web visualization in one command
84
+ waze collect --web
85
+
86
+ # Or specify a custom port
87
+ waze collect --web --port 8080
88
+
89
+ # Open http://localhost:5000 (or your custom port)
90
+ ```
91
+
92
+ ### 3. Alternative: Run components separately
93
+
94
+ ```bash
95
+ # Collector only (no web UI)
96
+ waze collect
97
+
98
+ # Web UI only (view existing data)
99
+ waze web
100
+ waze web --port 8080
101
+ ```
102
+
103
+ ### 4. Explore the data
104
+
105
+ ```bash
106
+ waze status --all # Worldwide status & stats
107
+ waze summary # Collection summary
108
+ waze recent # Latest events
109
+ waze users # Active users
110
+ waze profile <user> # User movement analysis
111
+ ```
112
+
113
+ ### 5. Stop the collector
114
+
115
+ ```bash
116
+ waze stop --worldwide
117
+ ```
118
+
119
+ ## Worldwide Collector
120
+
121
+ The worldwide collector scans 5 continents in parallel using multithreading:
122
+
123
+ | Region | Priority 1 (Cities) | Priority 3 (Coverage) | Total |
124
+ |--------|--------------------|-----------------------|-------|
125
+ | Europe | 477 | 1,748 | 2,225 |
126
+ | Americas | 693 | 1,692 | 2,385 |
127
+ | Asia | 684 | 1,517 | 2,201 |
128
+ | Oceania | 216 | 481 | 697 |
129
+ | Africa | 315 | 833 | 1,148 |
130
+ | **Total** | **2,385** | **6,271** | **8,656** |
131
+
132
+ ### Collection Strategy
133
+
134
+ - **Priority 1 (Cities):** Major metropolitan areas, scanned every cycle
135
+ - **Priority 3 (Coverage):** Broader coverage areas, scanned every 10 cycles
136
+ - **Parallel scanning:** All 5 regions scanned simultaneously
137
+ - **WAL mode:** Thread-safe SQLite with Write-Ahead Logging
138
+
139
+ ## Web Visualization UI
140
+
141
+ The web UI provides real-time visualization at `http://localhost:5000`:
142
+
143
+ ### Features
144
+
145
+ - **Live Map:** Leaflet.js heatmap of worldwide events
146
+ - **Real-time Feed:** SSE-powered live event stream
147
+ - **Type Filtering:** Filter by POLICE (blue), ACCIDENT (red), JAM (orange), HAZARD (yellow), ROAD_CLOSED (purple)
148
+ - **User Tracking:** Search and filter events by specific username
149
+ - **Time Filters:** Filter by date range or hours ago
150
+ - **Leaderboard:** Top contributors ranked by event count
151
+ - **Click-to-Navigate:** Click any event in the live feed to fly to its location on the map
152
+
153
+ ### API Endpoints
154
+
155
+ | Endpoint | Description |
156
+ |----------|-------------|
157
+ | `/api/stats` | Summary statistics from all databases |
158
+ | `/api/events` | Events with filters (type, user, since, from, to) |
159
+ | `/api/heatmap` | Aggregated coordinates for heatmap layer |
160
+ | `/api/types` | Event types with counts |
161
+ | `/api/users` | User list with search |
162
+ | `/api/leaderboard` | Top contributors |
163
+ | `/api/stream` | Server-Sent Events for real-time updates |
164
+ | `/api/status` | Current collector status |
165
+
166
+ ## CLI Commands
167
+
168
+ ### Collection Control
169
+
170
+ ```bash
171
+ # Worldwide collector (recommended)
172
+ waze collect # Start worldwide collector
173
+ waze collect --web # Collector + web UI on port 5000
174
+ waze collect --web --port 8080 # Collector + web UI on custom port
175
+ waze collect -r europe -r asia # Collect from specific regions only
176
+
177
+ # Stop collectors
178
+ waze stop --worldwide # Stop worldwide collector
179
+ waze stop # Stop legacy Madrid collector
180
+
181
+ # Status
182
+ waze status # Basic status (Madrid DB)
183
+ waze status --all # Full status with all regional DBs
184
+ ```
185
+
186
+ ### Web Visualization
187
+
188
+ ```bash
189
+ waze web # Start web UI only (no collection)
190
+ waze web --port 8080 # Web UI on custom port
191
+ ```
192
+
193
+ ### Data Exploration
194
+
195
+ ```bash
196
+ waze summary # Worldwide collection summary
197
+ waze stats # Summary statistics
198
+ waze daily --all # Daily stats from all regions
199
+ waze recent # Last 20 events
200
+ waze recent -n 50 # Last 50 events
201
+ waze search -u <user> # Events from user
202
+ waze search -t police # Filter by type
203
+ waze search --since 2h # Last 2 hours
204
+ ```
205
+
206
+ ### User Analysis
207
+
208
+ ```bash
209
+ waze users # List users by activity
210
+ waze tracked # Show tracked users with most events
211
+ waze profile <username> # Detailed user profile
212
+ ```
213
+
214
+ ### Export
215
+
216
+ ```bash
217
+ waze export --format csv # Export to CSV
218
+ waze export --format geojson # Export for mapping
219
+ ```
220
+
221
+ ## Configuration
222
+
223
+ Regional configs are auto-generated on first run:
224
+ - `config_europe.yaml`
225
+ - `config_americas.yaml`
226
+ - `config_asia.yaml`
227
+ - `config_oceania.yaml`
228
+ - `config_africa.yaml`
229
+
230
+ ## Project Structure
231
+
232
+ ```
233
+ waze-madrid-logger/
234
+ ├── pyproject.toml # Package config (installs 'waze' command)
235
+ ├── cli.py # CLI entry point (with integrated collector + web UI)
236
+ ├── collector_worldwide.py # Standalone multithreaded collector
237
+ ├── database.py # SQLite operations (WAL mode)
238
+ ├── analysis.py # Stats and profiling
239
+ ├── waze_client.py # Direct Waze API client
240
+ ├── web/
241
+ │ ├── app.py # Flask web application
242
+ │ └── templates/
243
+ │ └── index.html # Map visualization UI
244
+ ├── config_*.yaml # Regional configurations (auto-generated)
245
+ ├── *_grid.py # Grid cell generators
246
+ ├── data/
247
+ │ ├── waze_europe.db
248
+ │ ├── waze_americas.db
249
+ │ ├── waze_asia.db
250
+ │ ├── waze_oceania.db
251
+ │ ├── waze_africa.db
252
+ │ ├── collector_status.json # Real-time status for web UI
253
+ │ └── collector_checkpoint.json # Resume checkpoint
254
+ └── logs/
255
+ └── cli_collector.log
256
+ ```
257
+
258
+ ## Privacy & Ethics
259
+
260
+ This tool is for **security research and education** - demonstrating privacy risks in Waze's design.
261
+
262
+ **Do not use for:**
263
+ - Stalking or tracking individuals
264
+ - Publishing identifiable data
265
+ - Any illegal surveillance
266
+
267
+ ## License
268
+
269
+ MIT
270
+
271
+ ---
272
+
273
+ ## Annex: Sample Outputs
274
+
275
+ ### CLI Collector Startup (`waze collect --web`)
276
+
277
+ ```
278
+ Starting worldwide collector...
279
+ Web UI will be available at http://localhost:5000
280
+ ======================================================================
281
+ WAZE WORLDWIDE COLLECTOR (CLI)
282
+ ======================================================================
283
+ EUROPE - P1 (cities): 477, P3 (coverage): 1748
284
+ AMERICAS - P1 (cities): 693, P3 (coverage): 1692
285
+ ASIA - P1 (cities): 684, P3 (coverage): 1517
286
+ OCEANIA - P1 (cities): 216, P3 (coverage): 481
287
+ AFRICA - P1 (cities): 315, P3 (coverage): 833
288
+ ----------------------------------------------------------------------
289
+ TOTAL - P1 (cities): 2385, P3 (coverage): 6271
290
+ Grand total: 8656 grid cells
291
+ ======================================================================
292
+ Collection strategy (MULTITHREADED):
293
+ - All regions scanned in PARALLEL for P1 (city) scans
294
+ - Full P3 (coverage) scan every 10 cycles (parallel)
295
+ - 10 second pause between cycles
296
+ - Web UI at http://localhost:5000
297
+ ======================================================================
298
+ ```
299
+
300
+ ### Parallel Scanning Output
301
+
302
+ ```
303
+ ==================================================
304
+ CYCLE 1 (PARALLEL MODE)
305
+ ==================================================
306
+ Starting parallel P1 scan across 5 regions...
307
+ [ 1/315] abidjan (CI) -> 4 alerts, +4 new | HAZARD:1, JAM:1, POLICE:1
308
+ [ 1/684] abu_dhabi (AE) -> 9 alerts, +1 new | JAM:1
309
+ [ 1/693] arequipa (PE) -> 181 alerts, +6 new | HAZARD:3, POLICE:2, JAM:1
310
+ [ 1/216] adelaide (AU) -> 38 alerts, +38 new | ROAD_CLOSED:31, POLICE:7
311
+ [ 1/477] amsterdam (NL) -> 183 alerts, +3 new | HAZARD:3
312
+ [EUROPE] +4 events, 0 errors
313
+ [ASIA] +1 events, 0 errors
314
+ [AFRICA] +9 events, 0 errors
315
+ [AMERICAS] +7 events, 0 errors
316
+ [OCEANIA] +190 events, 0 errors
317
+ P1 cycle complete: +211 total events, 0 errors
318
+ ```
319
+
320
+ ### API Response: /api/stats
321
+
322
+ ```json
323
+ {
324
+ "total_events": 28709,
325
+ "unique_users": 28496,
326
+ "first_event": "2021-02-28T00:00:00+00:00",
327
+ "last_event": "2026-01-24T10:36:15+00:00"
328
+ }
329
+ ```
330
+
331
+ ### API Response: /api/leaderboard
332
+
333
+ ```json
334
+ [
335
+ {"rank": 1, "username": "world_3e440399", "count": 3, "last_seen": "2026-01-24T08:09:24+00:00"},
336
+ {"rank": 2, "username": "world_9886cdb3", "count": 3, "last_seen": "2026-01-24T08:33:22+00:00"},
337
+ {"rank": 3, "username": "world_9e5e1c59", "count": 3, "last_seen": "2026-01-24T08:24:36+00:00"}
338
+ ]
339
+ ```
340
+
341
+ ### Live Feed Event (SSE)
342
+
343
+ ```json
344
+ {
345
+ "type": "new_event",
346
+ "event": {
347
+ "id": "europe_12345",
348
+ "username": "user123",
349
+ "latitude": 52.3676,
350
+ "longitude": 4.9041,
351
+ "timestamp": "2026-01-24T10:30:00+00:00",
352
+ "report_type": "POLICE",
353
+ "subtype": "POLICE_VISIBLE",
354
+ "grid_cell": "amsterdam",
355
+ "region": "europe"
356
+ }
357
+ }
358
+ ```
359
+
360
+ ### Status Command (`waze status --all`)
361
+
362
+ ```
363
+ === Collector Status ===
364
+ Worldwide: Running (PID 2251683)
365
+ Madrid: Stopped
366
+ Europe: Stopped
367
+
368
+ === Regional Database Summary ===
369
+ Region Events Users First Last
370
+ -------- -------- ------- ---------- ----------
371
+ MADRID 272 227 2025-07-31 2026-01-24
372
+ EUROPE 17,561 17,412 2021-02-28 2026-01-24
373
+ AMERICAS 9,794 9,781 2023-09-21 2026-01-24
374
+ ASIA 3,017 3,017 2023-08-16 2026-01-24
375
+ OCEANIA 996 995 2023-12-31 2026-01-24
376
+ AFRICA 1,120 1,120 2025-06-21 2026-01-24
377
+
378
+ === Totals ===
379
+ Total events: 32,760
380
+ Unique users: 32,498
381
+ Time range: 2021-02-28T00:00:00 -> 2026-01-24T11:00:48
382
+
383
+ By type (all regions):
384
+ HAZARD 15,958 (48.7%)
385
+ ROAD_CLOSED 10,107 (30.9%)
386
+ JAM 3,289 (10.0%)
387
+ POLICE 3,016 (9.2%)
388
+ ACCIDENT 360 (1.1%)
389
+ CHIT_CHAT 30 (0.1%)
390
+ ```
391
+
392
+ ### Summary Command (`waze summary`)
393
+
394
+ ```
395
+ === Worldwide Collection Summary ===
396
+ Total events: 32,760
397
+ Unique users: 32,498
398
+ Days collected: 45
399
+ Grid cells used: 2,156
400
+ First event: 2021-02-28T00:00:00
401
+ Last event: 2026-01-24T11:00:48
402
+ Avg events/day: 728.0
403
+
404
+ === By Region ===
405
+ EUROPE 17,561 events 17,412 users (53.6%)
406
+ AMERICAS 9,794 events 9,781 users (29.9%)
407
+ ASIA 3,017 events 3,017 users (9.2%)
408
+ AFRICA 1,120 events 1,120 users (3.4%)
409
+ OCEANIA 996 events 995 users (3.0%)
410
+ MADRID 272 events 227 users (0.8%)
411
+ ```
@@ -0,0 +1,15 @@
1
+ analysis.py,sha256=mbF5WvfB6fCcad_hHW1rivvGRBWhJ3Q60ZIdorrBp70,2941
2
+ cli.py,sha256=AFbsMtFNgmLyJi7uVbcJChKSKJMGDQk0r4G6YRlrToA,43052
3
+ collector.py,sha256=xR5GJnrDqz8cEeuAw1chrqdLCQZnoxvipHZNX-LOUUY,6844
4
+ collector_europe.py,sha256=sO5azi-7D-Ho_CMTSNvZ9YrhhHsyh73CJLKoJVlSLCE,11159
5
+ collector_worldwide.py,sha256=t62V_SlusIYy8tDPdEN13hHGN5_807CDxs6N0ZwyFUc,20485
6
+ database.py,sha256=hIAY-LBXB03wnvQP2oLtDpZMIJHa7Rjr6N5w5BynZS4,7191
7
+ waze_client.py,sha256=Qzt53Zj5KS9xGH4zdGPht0-bd-4SdEKZ4UNeJXVXbWs,8263
8
+ waze_logs-1.0.0.dist-info/licenses/LICENSE,sha256=01FhnxH_DtCPMrOTEHCnT1UFgJnUVGnuTTA-aIYMQ78,1070
9
+ web/app.py,sha256=o7C1INu1k49UIIZbBso87MHDrCG_fbEIaQ7Dm1CZRXI,18202
10
+ web/templates/index.html,sha256=nRe-tH7uNm6gRejbu9CS0kHTZfjmIaVE7Uz2I6bn-Mg,40422
11
+ waze_logs-1.0.0.dist-info/METADATA,sha256=2ToQM5AaIUlcZnM1DAbcGYDq9sAPCNDE6paihdVjCFU,13530
12
+ waze_logs-1.0.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
13
+ waze_logs-1.0.0.dist-info/entry_points.txt,sha256=i6ypFEZ8m2ed35EKAnDU04gLgc2Eyvcx9L4OCAR-cZ4,33
14
+ waze_logs-1.0.0.dist-info/top_level.txt,sha256=gdlhsXAs6vbHoK4ws43h1ylP1V0u9KUcjEqsmQhA0A4,85
15
+ waze_logs-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ waze = cli:cli
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 jasperan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ analysis
2
+ cli
3
+ collector
4
+ collector_europe
5
+ collector_worldwide
6
+ database
7
+ waze_client
8
+ web