Skip to content

ricotti19/C02_Emissions_Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C02_Emissions_Tracker

Basic Info

PM Info

Description CO2 Emissions Tracker web app built with Python (Flask), HTML, and SQLite. Users can log trips by selecting a city (from 20 Texas cities), entering the distance in kilometers, and choosing one of four vehicle types - hybrid/electric/diesel/gasoline. The app calculates CO2 emissions based on these inputs, stores the totals in the database, and displays an interactive bar chart to compare emissions across cities. Demonstrates basic front-end web development and back-end database integration skills.

Dependencies

Installation

1. Clone the repository:
git clone https://github.com/ricotti19/CO2-Emissions-Tracker.git

2. Navigate into the folder:
cd C02_Emissions_Tracker

3. Install dependencies:
pip install Flask==3.1.2
pip install Jinja2==3.1.6
pip install click==8.3.0
pip install colorama==0.4.6
pip install blinker==1.9.0
pip install itsdangerous==2.2.0
pip install markupsafe==3.0.2
pip install werkzeug==3.1.3

Note: these packages are needed in order to run c02_emissions_tracker.py

4. Run the app:
python c02_emissions_tracker.py

5. Open the app in browser:
(Go to) http://127.0.0.1:5000 (to view the interactive app)

Folder Structure

DFR/
├── templates/
│   └── index.html
├── co2_emissions_tracker.py
├── co2data.db
├── trips.db
└── README.md

Usage

  1. Select a city from the dropdown menu listing 20 Texas cities
  2. Enter the trip distance (km)
  3. Choose the vehicle type (hybrid/electric/diesel/gasoline)
  4. Click Add Trip to update the chart
  5. If needed, click Reset All Emissions to start over

Example of output

image

About

Calculates and displays C02 Emissions for select TX cities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published