Euro NCAP Rating 2026
This repository provides tools for calculating Euro NCAP rating scores for 2026. It includes utilities for data conversion, score computation, and visualization of results.
Installation
Euro NCAP Rating 2026 can be installed using pip.
Prerequisites
Before installing the package, ensure you have the following prerequisites:
- Python: Version 3.10 or higher is required. You can download Python from the official website.
Using a Virtual Environment (Recommended)
It is recommended to use a Python virtual environment to isolate dependencies and avoid conflicts with other Python projects.
You only need to create the virtual environment once; after that, simply activate it whenever you work on the project.
On Linux/macOS:
python3 -m venv venv # Create once
source venv/bin/activate # Activate each time
On Windows (Command Prompt):
python -m venv venv # Create once
venv\Scripts\activate.bat # Activate each time
On Windows (PowerShell):
python -m venv venv # Create once
venv\Scripts\Activate.ps1 # Activate each time
Once the virtual environment is activated, you can proceed with the installation steps below.
From PyPi
The recommended way to install the package is via PyPi, which is the default package index for Python.
To install the package from PyPi or upgrade to the latest version when a new release is available, use:
pip install --upgrade euroncap-rating-2026
From GitHub repository
It is also possible to install the package directly from the public GitHub repository or from a local clone.
Ensure you have the following additional prerequisites installed:
- Git: Required for installation from the GitHub repository. You can download Git from the official website.
To upgrade to the latest version from the GitHub repository, use:
pip install --upgrade euroncap_rating_2026@git+https://github.com/Euro-NCAP/euroncap_rating_2026
Usage
The application is organized into five domains, each exposed as a sub-command:
| Domain | Sub-command | Template prefix |
|---|---|---|
| Crash Protection | crash_protection |
cp_ |
| Crash Avoidance | crash_avoidance |
ca_ |
| Safe Driving | safe_driving |
sd_ |
| Post Crash | post_crash |
pc_ |
| Overall rating | overall |
overall_ |
The first four domains share the same three-step workflow. The overall domain has no preprocess step: it reads the four domain reports and computes the star rating.
General workflow for a domain:
- Run
generate-templateto create the input template (<prefix>template.xlsx) in the current directory. - Fill in the required fields (grey cells) in the generated template.
- Run
preprocess -i <prefix>template.xlsxto expand the template (test points, load cases); this writes<prefix>preprocessed_template.xlsx. - Complete any additional required fields in the preprocessed file.
- Run
compute-score -i <prefix>preprocessed_template.xlsxto calculate the results; this writes<prefix><date>_<time>_report.xlsx.
Example: Crash Protection
Generate the input template:
euroncap_rating_2026 crash_protection generate-template
This creates cp_template.xlsx in your current directory.
Preprocess:
After filling in the required fields (such as the VRU Prediction Matrix), run:
euroncap_rating_2026 crash_protection preprocess -i cp_template.xlsx
This generates cp_preprocessed_template.xlsx with the additional sheets needed for the assessment.
Compute scores:
euroncap_rating_2026 crash_protection compute-score -i cp_preprocessed_template.xlsx
Example: Crash Avoidance, Safe Driving and Post Crash
The same three commands apply, with the domain name and template prefix changed:
euroncap_rating_2026 crash_avoidance generate-template
euroncap_rating_2026 crash_avoidance preprocess -i ca_template.xlsx
euroncap_rating_2026 crash_avoidance compute-score -i ca_preprocessed_template.xlsx
euroncap_rating_2026 safe_driving generate-template
euroncap_rating_2026 safe_driving preprocess -i sd_template.xlsx
euroncap_rating_2026 safe_driving compute-score -i sd_preprocessed_template.xlsx
euroncap_rating_2026 post_crash generate-template
euroncap_rating_2026 post_crash preprocess -i pc_template.xlsx
euroncap_rating_2026 post_crash compute-score -i pc_preprocessed_template.xlsx
Rating protocol
A workbook generated for another rating programme records that protocol in its Version sheet (Protocol row). euroncap_rating_2026 itself writes no such row: a workbook without it is a Euro NCAP 2026-2028 workbook, which is what this command line generates and scores. preprocess, compute-score and the overall roll-up refuse a file generated for another protocol, so a file cannot be scored with the wrong rules by mistake.
Other rating programmes built on this package are provided as separate packages that register their protocol, Safe Driving master template and Speed Assistance profile at import time and ship their own command line. Installing such a package does not change how euroncap_rating_2026 behaves.
Example: Overall rating
The overall rating combines the four domain reports. Place the *_report.xlsx files produced by the four compute-score runs in one directory and pass it with -p:
euroncap_rating_2026 overall generate-template
euroncap_rating_2026 overall compute-score -i overall_template.xlsx -p <directory with the four *_report.xlsx files>
Command-line Help
Every command and sub-command supports --help:
euroncap_rating_2026 --help
euroncap_rating_2026 crash_protection --help
euroncap_rating_2026 crash_protection compute-score --help
Each of the first four domains provides the sub-commands generate-template, preprocess and compute-score; overall provides generate-template and compute-score. Example:
$ euroncap_rating_2026 crash_protection --help
Usage: euroncap_rating_2026 crash_protection [OPTIONS] COMMAND [ARGS]...
Commands for domain crash_protection.
Options:
-h, --help Show this message and exit.
Commands:
compute-score Compute NCAP scores from an input Excel file.
generate-template Generate a template for crash protection.
preprocess Preprocess VRU test points and generate loadcases...
preprocess and compute-score accept -i/--input_file (required) and -o/--output_path (defaults to the current directory).
Version Handling
The application performs version checks at each processing step to ensure compatibility between different stages of the workflow.
Each command (generate-template, preprocess, and compute-score) writes its current version information to the output file. When a subsequent command reads an input file, it compares the version that created the file with the current application version.
Version Mismatch Behavior:
-
Patch version mismatch (e.g., 1.0.0 vs 1.0.1): A warning is displayed, but processing continues. Patch updates typically contain bug fixes that don't affect compatibility.
-
Minor or major version mismatch (e.g., 1.0.0 vs 1.1.0 or 2.0.0): Processing stops with an error message asking you to upgrade the application. Minor and major updates may include breaking changes or new features that require the latest version.
Example:
If you preprocessed a file with version 1.0.0 but are running compute-score with version 1.1.0, you'll see an error like:
Error: Version mismatch detected. File was created with version 1.0.0, but current version is 1.1.0.
Please upgrade the application using: pip install --upgrade euroncap-rating-2026
To resolve this, upgrade to the latest version:
pip install --upgrade euroncap-rating-2026
Then regenerate your files starting from the appropriate step.
Input Format
The application expects the input file to be in .xlsx format.
-
Input Requirements: Users must provide values for all cells in the template that are highlighted with a light grey background. These cells represent the required input data for the application to compute the scores.
-
For the VRU test, the user must provide a prediction for each cell in the VRU Prediction Matrix by selecting a color-coded value. Each cell contains a dropdown menu with the available options, which represent the possible prediction outcomes. The selectable values are:
- Blue
- Brown
- Dark Red
- Green
- Green-20
- Green-30
- Green-40
- Grey
- Orange
- Red
- Yellow
Output Format
The output is an updated .xlsx file where all scoring cells are filled with computed scores.
The output file is saved with the naming convention <prefix>DATE_TIME_report.xlsx, where <prefix> is the domain prefix (cp_, ca_, sd_, pc_ or overall_) and DATE_TIME is the current date and time in the format YYYY-MM-DD_HH-MM-SS. For example, a Crash Protection report generated on March 15, 2026, at 14:30:45 is named cp_2026-03-15_14-30-45_report.xlsx.
This naming convention ensures that each output file is unique and timestamped for easy identification.
- Output Details: The cells updated by the application are highlighted with a yellow background in the output file, making it easy to identify the computed results.
Development
Configuration Options
For development, different configuration options are available. The application can be run in debug mode, which provides additional logging and a GUI for debugging purposes.
The application supports two configuration options:
log_level: Controls the logging level of the application (e.g.,DEBUG,INFO,WARNING,ERROR,CRITICAL).
Configuration options can be specified using environment variables.
EURONCAP_RATING_2026_LOG_LEVEL: Sets the logging level.
You can set the following environment variables before running the application:
On Linux/macOS:
export EURONCAP_RATING_2026_LOG_LEVEL=DEBUG
On Windows (Command Prompt):
set EURONCAP_RATING_2026_LOG_LEVEL=DEBUG
On Windows (PowerShell):
$env:EURONCAP_RATING_2026_LOG_LEVEL="DEBUG"
Installation from source
To run tests and develop the project, you need to install it from source.
After cloning the repository, install the project using Poetry.
poetry install
After installing from source, the usage is similar to above.
Usage: euroncap_rating_2026 [OPTIONS] COMMAND [ARGS]...
Euro NCAP Rating Calculator 2026 application to compute NCAP scores.
Options:
-h, --help Show this message and exit.
Commands:
crash_avoidance Commands for domain crash_avoidance.
crash_protection Commands for domain crash_protection.
overall Commands for domain overall.
post_crash Commands for domain post_crash.
safe_driving Commands for domain safe_driving.
Tests
Unit Tests
Unit tests can be executed with the command:
python -m unittest discover -s tests # or: poetry run python -m unittest discover -s tests
The suite takes a couple of minutes and ends with a summary such as Ran 1802 tests ... OK. CI runs the suite on Linux and Windows for Python 3.10 to 3.13, checks formatting with black --check, and runs generate-template for all five domains as a smoke test (see .github/workflows/test.yml).
You can check more options for unittest at its own documentation.
Python Library Licenses
Below is a list of the Python libraries used in this project along with their respective licenses and PyPI links.
| Library | Version | License | PyPI Link |
|---|---|---|---|
| pandas | ^2.2.3 | BSD-3-Clause | pandas |
| pydantic | ^2.11.1 | MIT | pydantic |
| pydantic-settings | ^2.8.1 | MIT | pydantic-settings |
| openpyxl | ^3.1.5 | MIT | openpyxl |
| click | ^8.1.7 | BSD-3-Clause | click |
Metadata
Release files for euroncap-rating-2026 5.4.10
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 |
|---|---|---|---|---|
| euroncap_rating_2026-5.4.10.tar.gz | 466.6 kB | Without provenance | Details for euroncap_rating_2026-5.4.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| euroncap_rating_2026-5.4.10-py3-none-any.whl | Python 3 | none | any | Details for euroncap_rating_2026-5.4.10-py3-none-any.whl |
Total release size: 976.4 kB
Release files / euroncap_rating_2026-5.4.10.tar.gz
| Download URL | euroncap_rating_2026-5.4.10.tar.gz |
|---|---|
| Size | 466.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a829a169bd95a5b46c2da4f97bf4eb484312f241f750d2f12d00a8156c66d69
|
|
BLAKE2b-256 checksum How to use checksums |
29ed7d4bda62ea6b8c190fca0150238551e912f280b08f56122da78f07840ffd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / euroncap_rating_2026-5.4.10-py3-none-any.whl
| Download URL | euroncap_rating_2026-5.4.10-py3-none-any.whl |
|---|---|
| Size | 509.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c1ca9e6b080fcd8d28cd6f1b29305cd7b88513f382471d5c32ac424a969999e
|
|
BLAKE2b-256 checksum How to use checksums |
13b02ea6fea575e1361da68fabc1fe8c0450bebf87ffad5fa66ab76d2d1489ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Security for euroncap-rating-2026 5.4.10
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.