CAF.mat
CAF.mat contains functionality for reading, writing and performing calculations with transport modelling matrices. The aim is to provide a consistent method for interacting with all types of transport matrices from Python, with some additional front-end features for more common matrix operations.
Table of Contents
Overview
What does it do?
CAF.mat is primarily a Python package for interacting with transport modelling matrices in various file formats. The package provides a set of classes for interacting with matrices and ties into some other CAF packages, namely caf.base.
The package also provides a standalone CLI tool for some more common matrix operations.
Main Features
- Matrices Classes - custom Python classes to handle groups of matrices, builds on top of
caf.base's
SegmentationandZoningSystemfunctionality and provides access to individual matrices as pandas DataFrames. - Various File Formats - read, write and convert between various matrix file formats from
different transport modelling software.
- OpenMatrix (OMX)
- SATURN's UFM
- CUBE's (MAT)
- Any Matrix Data - can handle any type of matrix data e.g. travel demand and transport costs.
- Tour Modelling Conversions - functions to convert between OD and PA based matrices, as used in tour based transport demand modelling.
Work-in-Progress
- UFM Comparisons - functionality to compare different UFM files (see #17).
- Matrix Adjustments - adjust a matrix to a target matrix at a specified sector level (see #18).
Who is it for?
- Target audience: Transport Modellers
- CAF Analytical Stage: Modelling, Appraisal
For more details on CAF Analytical Stages see the description within TfN's GitHub homepage
Where to get it
The latest released version are available at the Python Package Index (PyPI) and on Conda.
conda install -c conda-forge caf.mat
pip install caf.mat
Installation from GitHub
The latest, unreleased, version can be installed directly from GitHub using:
pip install "git+https://github.com/transport-for-the-north/caf.mat"
Usage
caf.mat provides and Command-line (CLI) and graphical interface (GUI) to use many of it's features without the need to write any Python code, see the Tool Usage section of the user guide for more details.
Command Line
The tool can be run from command line, with the command:
caf.mat
See Command-Line Interface (User Guide) for full explanations of the parameters.
Documentation
The code documentation is hosted at https://cafmat.readthedocs.io/en/stable/.
What is CAF?
This tool is part of TfN's Common Analytical Framework (CAF). CAF is Transport for the North's structured suite of analytical tools designed to support transport modelling, appraisal, and strategic decision-making.
More information on CAF and details on other CAF tools can be found on TfN's GitHub Homepage.
Contribution
We encourage use of, and contributions to, the repositories within this organisation, licenses are provided within the repositories and the organisation contribution guide provides details for contributions.
Contact Us
For further information about using this tool or CAF tools in your projects and work contact Transport for the North - TfNOffer@transportforthenorth.com
Metadata
Release files for caf.mat 0.1.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 | |
|---|---|---|---|
| caf_mat-0.1.0.tar.gz | 50.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| caf_mat-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 95.2 kB
Release files / caf_mat-0.1.0.tar.gz
| Download URL | caf_mat-0.1.0.tar.gz |
|---|---|
| Size | 50.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8f2c16f20b6b5463394cd5b0345f3fc8e48a9249167731cccac184f8f8507c5
|
|
BLAKE2b-256 checksum How to use checksums |
0efbde0ce3c356ff551a2c58594eaa91eefd93e8600b1440efc80782ce57cb3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.
Transparency logRelease files / caf_mat-0.1.0-py3-none-any.whl
| Download URL | caf_mat-0.1.0-py3-none-any.whl |
|---|---|
| Size | 45.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c7f55474871530522c4fc4c1d38174b0103e51d7eda197faf0025c441097c14
|
|
BLAKE2b-256 checksum How to use checksums |
854c9af07a98d931258b46bde5c84bdc159ee3a6aef3c6f898476fbbc59728b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.
Transparency log