We gathered electric vehicle charging station data from OpenChargeMap and used it to create a PostgreSQL database, a Flask API, and a dashboard web page with a variety of maps and graphs.
- Charles Sisemseghan
- Emmanuel Montano
- Kali Schoenrock
- Stephanie Gutierrez
- Sydney Salinas
- Zachary Aaronson
Our data was collected from OpenChargeMap for all locations in the United States. Additional reference data was also downloaded using the API. The data was then cleaned using Python and Pandas the exported to CSV and JSON files. The code to do this can be found in fetch_and_process_data.ipynb
, though you will need an API key from OpenChargeMap stored in api_keys.py
.
OpenChargeMap collects their data mostly from crowd sourcing and data imports from public or open data [Source]. Due to the crowd sourcing, data is likely to have some inaccuracies due to inconsistent data entry or missing data.
A PostgreSQL database was created using charging_db.sql
and the CSV files in data/
to hold the charging station data along with the reference data.
Steps to Use:
- Run the
CREATE TABLE
andALTER TABLE
queries fromcharging_db.sql
. - In pgadmin, use the import tool to import the csv files to the correct table
- import
reduced_data.csv
for thestations
table last. - Do NOT include the "ID" column when importing into
stations
.
- import
- Run the test
SELECT
queries at the bottom of the sql file.
A Flask API was created to showcase retrieving our data from an API. Github pages only runs for static pages so Python and Flask can't be used directly with our website.
Steps to Use:
- First create the SQLite database using
Create_sqlite.py
reduced_data.sqlite
should be created in the data/ folder
- Run the flask app with
flask_app.py
- Go to your localhost with the correct port number in your browser to access the API.
- State names are two characters long (ex: TX)
The website has a leaflet map with two different layers. There are also three bar charts that can have their data filtered by state.
- Python
- GeoPy
- Pandas
- Requests
- SQLAlchemy
- Flask
- JavaScript
- D3.js
- Plotly
- Leaflet
- PostgreSQL
- SQLite