Realtime Dashboard with Python: Difference between revisions
From wikiluntti
(Created page with "== Introduction == What is needed * Read the CSV file in a robust manner * Make some maths a * Plot and update the graphs * Show the map and GNSS coordinates == Read the CSV == == Real time plotting == == GIS and maps ==") |
|||
(11 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
== Read the CSV == | == Read the CSV == | ||
See https://labex.io/tutorials/python-how-to-implement-robust-error-handling-in-python-csv-processing-398214 | |||
Common errors | |||
* CSV Parsing Errors | |||
** csv.Error: the CSV file has an invalid or unexpected format, such as missing or extra delimiters. | |||
** UnicodeDecodeError: the CSV file contains characters that cannot be decoded using the default encoding | |||
* Data-related Errors | |||
** ValueError: CSV file does not match the expected data type or format. | |||
** IndexError: trying to access a row or column that does not exist in the CSV file. | |||
We will skip the erratic data. | |||
== Real time plotting == | == Real time plotting == | ||
Create GUI: https://blog.finxter.com/5-best-ways-to-display-real-time-graphs-in-a-simple-ui-for-a-python-program/ | |||
* Matplotlib | |||
* Pyqtgraph with PyQt5 | |||
* Plotly with Dash | |||
* Bokeh | |||
* liveplot package | |||
Update Matplotlib | |||
* https://stackoverflow.com/questions/4098131/how-to-update-a-plot-in-matplotlib/4098938#4098938 | |||
* https://stackoverflow.com/questions/4129697/how-do-i-display-real-time-graphs-in-a-simple-ui-for-a-python-program | |||
== GIS and maps == | == GIS and maps == | ||
OSM Data files https://osmtoday.com/ or https://download.geofabrik.de/ | |||
pbf format: | |||
* Pyosmium to efficiently read and process OpenStreetMap data files | |||
* Pyrosm [on Windows installing geopandas with pip is likely to cause issues, hence, it is recommended to install Geopandas before installing pyrosm] | |||
* Osmnx https://osmnx.readthedocs.io/en/stable/installation.html | |||
https://pythongis.org/ | |||
* Interactive Maps | |||
** Leaflet.js | |||
** folium | |||
** visualize OpenStreetMap on a specific location. | |||
GeoPandas. | |||
Data in a Google Map with Python (https://thedatafrog.com/en/articles/show-data-google-map-python/) | |||
* a Google Map API Key |
Latest revision as of 22:08, 11 April 2025
Introduction
What is needed
- Read the CSV file in a robust manner
- Make some maths a
- Plot and update the graphs
- Show the map and GNSS coordinates
Read the CSV
Common errors
- CSV Parsing Errors
- csv.Error: the CSV file has an invalid or unexpected format, such as missing or extra delimiters.
- UnicodeDecodeError: the CSV file contains characters that cannot be decoded using the default encoding
- Data-related Errors
- ValueError: CSV file does not match the expected data type or format.
- IndexError: trying to access a row or column that does not exist in the CSV file.
We will skip the erratic data.
Real time plotting
Create GUI: https://blog.finxter.com/5-best-ways-to-display-real-time-graphs-in-a-simple-ui-for-a-python-program/
- Matplotlib
- Pyqtgraph with PyQt5
- Plotly with Dash
- Bokeh
- liveplot package
Update Matplotlib
- https://stackoverflow.com/questions/4098131/how-to-update-a-plot-in-matplotlib/4098938#4098938
- https://stackoverflow.com/questions/4129697/how-do-i-display-real-time-graphs-in-a-simple-ui-for-a-python-program
GIS and maps
OSM Data files https://osmtoday.com/ or https://download.geofabrik.de/
pbf format:
- Pyosmium to efficiently read and process OpenStreetMap data files
- Pyrosm [on Windows installing geopandas with pip is likely to cause issues, hence, it is recommended to install Geopandas before installing pyrosm]
- Osmnx https://osmnx.readthedocs.io/en/stable/installation.html
- Interactive Maps
- Leaflet.js
- folium
- visualize OpenStreetMap on a specific location.
GeoPandas.
Data in a Google Map with Python (https://thedatafrog.com/en/articles/show-data-google-map-python/)
- a Google Map API Key