Library to calculate CO2 (equivalent) emissions for a given transport trip.
Project description
Transport CO2
Calculate CO2 (equivalent) emissions for a given transport trip and provide a simple interpretation of the result.
Install from PyPI via
pip install transport-co2
Usage examples
You can list the currently supported modes like so:
from transport_co2 import Mode
list(Mode)
Each Mode
allows you to estimate the CO2 emission per passenger for a journey given its distance (in km):
Mode.SMALL_CAR.estimate_co2(distance_in_km=100)
# 11200.0
This estimate is based on an average occupancy (in this example 1.5
). You can also specify the occupancy:
Mode.SMALL_CAR.estimate_co2(distance_in_km=100, occupancy=3)
# 5600.0
If you don't want to work with the Mode
enum, you can instead work with the estimate_co2
function:
from transport_co2 import estimate_co2
estimate_co2(mode="light_rail", distance_in_km=100)
# 1400.0
You can also specify the occupancy like above:
estimate_co2(mode="light_rail", distance_in_km=100, occupancy=250)
# 873.6
Running unit tests
In order to run the unit tests for this project:
- activate the virtual environment with
pipenv shell
- run
pytest
Goals
This project is intended to be used to help raise awareness about the cost of transportation choices, so people can make informed decisions.
Initial focus
We are initially focused on ground (road and rail) transport, as it is the most significant source on transport greenhouse gas emissions.
API Design
This library intends to provide:
- a statistical estimate of greenhouse gase emissions given information about a trip (origin/destination, mode, and/or distance)
- a simple interpretation of the statistical emissions estimate, in terms such as "high" or "low"
Research
The carbon estimates produced by this model may be based on the following resources. A full description of the model, including data sources, will be provided as the library takes shape.
- European Environment Agency CO2 emissions from passenger transport
Further improvements to the model may come from other sources, such as the following.
- IPCC AR5 Chapter 8 - Transport
- Wikipedia: Environmental impact of transport
Attribution
Initial package structure forked from navdeep-G/setup.py.
Friendly nod to jamiebull1/transport-carbon.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for transport_co2-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ba03accb453b87ad85daa57b46ee6c18d86791969d6367f38a2ae66bc877f0 |
|
MD5 | 59c18cb13da36c0b74d1b1d808aad8f8 |
|
BLAKE2b-256 | 708db078a17936b971641427f2c9d56b1a48fbc8056ff76ae55c311047761ad2 |