Skip to content

pauleentalay/GuiltyOldCars

Repository files navigation

GuiltyOldCars

On-going project. The project started and was presented for ReDI - Python Intermediate Course, Autumn 2021. The program scrapes car data from ebay.de and stores in SQL. It extracts information and summarizes carbon dioxide emission from an available car registration file (see source below). The total mileage and rate of carbon dioxide emission for each brand is used to compute the total amount of carbon dioxide emitted of each brand.

Files:

scrape:

  • Scrapes ebay.de for carlinks in pagea of Autorad & Motorrad: Fahrzeuge -> Automobile

schema:

  • Creates a database cars_scrape.db containing the links to individual pages, and the car info obtained

main:

  1. drops and creates database;
  2. get links, adds to database; Change number of pages here if you would want to run the program quickly.
  3. gets car info, adds to database,
  4. gets emission data, matches according to brand name, updates database with this emissions data
  5. queries by brand: emissions = emission * mileage, count per brand, total cost per total emitted tonne CO2
  6. plots horizontal bar graph, arranged accoring to amount of emission; plots only where brand count > 5

carbondata:

  • see below for source of emissions data

  • note: run fix_header and group_by_brand_model if using new data set from said source

  • use 'de_car_data_grouped.csv' for extracted columns for car brands, models, and emission in g/Km (specific CO2 emissions in g/Km (NEDC))

  • use 'de_car_data_brand.csv' in main.py for fixed and cleaned contianing brands and emission only (manually removed 'vw' in 'volkswagen vw')

Project photo so you don't need to run it as it may take sometime:

projectimage

Carbon dioxide data is from:

EEA Data: Monitoring of CO2 emissions from passenger cars – Regulation (EU) 2019/631 provided by European Environment Agency (EEA)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages