carculator
Prospective environmental and economic life cycle assessment of passenger cars and light-duty vehicles.
Developed at the Paul Scherrer Institute. This checkout prepares 1.9.6; see CHANGELOG.md for release status and changes.
Installation
Use Python 3.12 (>=3.12,<3.13) and a fresh environment. The shared runtime
requires NumPy >=1.26.4,<2.
python3.12 -m venv .venv
source .venv/bin/activate
On Windows, activate with .venv\Scripts\activate. After publication, install
this release from PyPI:
python -m pip install "carculator==1.9.6"
Before publication, use the matching source checkouts as described under development. Core calculations use bundled resources and need no Brightway project, ecoinvent installation or network access. Inventory export has optional dependencies:
python -m pip install "carculator[excel,brightway]==1.9.6"
The Brightway extra supports the legacy stack (bw2io<0.9, bw2data<4,
bw2calc<2). Export currently targets ecoinvent 3.9 and 3.10; importing those
inventories requires the corresponding background database in the destination tool.
Quick start
from carculator import (
CarInputParameters,
CarModel,
InventoryCar,
fill_xarray_from_input_parameters,
)
inputs = CarInputParameters()
inputs.static()
_, array = fill_xarray_from_input_parameters(
inputs,
scope={"size": ["Medium"], "powertrain": ["ICEV-p", "BEV"], "year": [2025]},
)
model = CarModel(array, cycle="WLTC")
model.set_all()
print(model["TtW energy"]) # kJ per vehicle-kilometre
inventory = InventoryCar(model, functional_unit="vkm")
impacts = inventory.calculate_impacts()
print(impacts.sel(impact_category="climate change").sum("impact"))
The example reports impacts per vehicle-kilometre.
Battery sizing
Set nominal capacity with energy_storage={"capacity": {("BEV", "Medium", 2025): 60}}.
Set pack mass through the input array parameter energy battery mass (kg).
Set a desired range with target_range={("BEV", "Medium", 2025): 400}.
Range targets supersede capacity overrides; capacity overrides supersede pack-mass inputs.
The range solver converges battery mass and energy demand together. See the
battery-sizing documentation for complete examples.
Modelling and validation
The vehicle models include native 2025 parameters and documented temporal extensions. These combine engineering priors and selected calibration evidence; they are not independent measurements for every vehicle configuration.
TtW energy is in kJ/km. For BEVs it is net stored-energy depletion;
model.battery_terminal_energy reports terminal DC separately, while
electricity consumption is grid electricity in kWh/km. Identify the measurement
boundary before comparing energy outputs. Availability-masked zeroes do not
represent physically zero consumption.
Supported background scenarios are SSP2-NPi, SSP2-PkBudg1000,
SSP2-PkBudg650, and static. ReCiPe supports midpoint/endpoint and EF midpoint.
Use fresh model instances for independent cases. inputs.stochastic(n, seed=...)
seeds parameter sampling, not every downstream cost adjustment.
See validation and limitations, migration notes and the documentation.
Development and release
Use matching sibling checkouts, especially carculator_utils 1.3.6 or newer:
python -m pip install -e "../carculator_utils[test,excel,brightway]" -e ".[test,docs,excel,brightway]"
python -m pip check
python -m pytest
python -m sphinx -b html docs docs/_build/html
The docs extra includes the extensions used by this repository.
See RELEASING.md for artifact verification, release order and publication.
Support and license
Contact carculator@psi.ch or open an issue. Maintained by Romain Sacchi, with contributions from the carculator development team. See contributing. Licensed under BSD-3-Clause.
Scientific background: Cox et al. (2018).
Metadata
Release files for carculator 1.9.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| carculator-1.9.6.tar.gz | 1.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| carculator-1.9.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.7 MB
Release files / carculator-1.9.6.tar.gz
| Download URL | carculator-1.9.6.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2220261bae6014ca804870000ed85150b66523437712a8e596a3d434be681575
|
|
BLAKE2b-256 checksum How to use checksums |
1e66c60a83dedd4c249f73078c3b60268630b88c28f00761232ad9ff10008c8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / carculator-1.9.6-py3-none-any.whl
| Download URL | carculator-1.9.6-py3-none-any.whl |
|---|---|
| Size | 105.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ec00afbd4cb1855e79739a5eb259663cdcfc7877de46d425c835512c7a69634
|
|
BLAKE2b-256 checksum How to use checksums |
0a7ac1ae3885e0acaab966f7169edd94be71042f28c6e1471e7799cb7aa40a4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|