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"
Carbon estimates
We try to provide a "best effort" estimate of CO2 emissions for transportation modes defined by the OpenTripPlanner project.
Our baseline estimates come from an infographic published by the European Environment Agency: CO2 emissions from passenger transport.
For modes not covered in the EEA infographic, we have used data from other sources (described below). In some cases, we have simply averaged values for several modes to provide estimates for more ambiguous modes, like CAR and TRANSIT.
Some mode energy estimates are based on megajoules for the petroleum consumed. For those modes, we used a petroleum average of 12g CO2 eq. per megajoule (The International Council on Clean Transportation, 2010).
For FERRY mode calculation we use the average of 6.8 MJ per passenger kilometer with an average occupancy of 91 (Schiller & Kenworthy, 2017, p. 143-144). We then estimate that each ferry passenger kilometer approximates to 81.6 g CO2, based on the above petroleum megajoule to grams CO2 conversion factor (6.8 * 12).
For SUBWAY (metro) mode calculation we use the average of 0.52 MJ per passenger kilometer with an average occupancy of 31 (Schiller & Kenworthy, 2017, pp. 143-144). We then estimate that each metro passenger kilometer approximates to 6.24 grams of CO2, based on the above petroleum megajoule to grams CO2 conversion factor (0.52 * 12).
Bibliography
- The International Council on Clean Transportation. (2010). Carbon Intensity of Crude Oil in Europe. Retrieved from https://theicct.org/sites/default/files/ICCT_crudeoil_Eur_Dec2010_sum.pdf
- Schiller, P. L., & Kenworthy, J. R. (2017). An Introduction to Sustainable Transportation. Abingdon, United Kingdom: Routledge.
Further reading
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.
Metadata
Release files for transport-co2 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| transport-co2-0.3.0.tar.gz | 7.5 kB | Without provenance | Details for transport-co2-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| transport_co2-0.3.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for transport_co2-0.3.0-py2.py3-none-any.whl |
Total release size: 13.7 kB
Release files / transport-co2-0.3.0.tar.gz
| Download URL | transport-co2-0.3.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc0a0d651c33cf899ee4063c4ed9b1a32c43cb842ea9f2aa252cf4474e876264
|
|
BLAKE2b-256 checksum How to use checksums |
19d56dda4a677e391f0856795c3e5a497cbc98591b5cb04e4e169cd10c0edc6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / transport_co2-0.3.0-py2.py3-none-any.whl
| Download URL | transport_co2-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e273983cdb237c9408db3a2e121ba455fdb754ce3b9111a91157c501fea4df0b
|
|
BLAKE2b-256 checksum How to use checksums |
a8403bc33648b2d052ff1eb2526f7a8f280831f57f82810b5b973452e1988896
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for transport-co2 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.