x3pio
Read and write ISO 25178-72 x3p files (.x3p) in Python.
x3p is the format of ISO 25178-72:2017 and Amd 1:2020 for the storage and exchange of topography and profile data. It stores profiles, surfaces on a regular or an irregular grid, in one or several layers, and point clouds as 3-D coordinates in a right-handed coordinate system, together with the metadata of the measurement and optional files of a vendor.
Installation
pip install x3pio
Usage
import numpy as np
import x3pio
# The metadata describes the measurement. The standard asks for a creation date, which a new
# file sets to now if the record has none, and for the kind of probing system.
metadata = x3pio.Metadata(
creator="Jane Doe",
instrument=x3pio.Instrument("Acme Metrology", "Scanner 3000", "12345", "firmware 2.1"),
probing_system=x3pio.ProbingSystem(x3pio.ProbingType.NON_CONTACTING, "confocal, 50x objective"),
comment="Reference artefact",
)
heights = np.zeros((480, 640)) # in metres
x3pio.write("surface.x3p", heights, x_scale=1e-6, y_scale=1e-6, metadata=metadata)
x3p = x3pio.read("surface.x3p")
print(type(x3p).__name__, len(x3p.layers)) # Surface 1
print(x3p.layers[0].z.shape) # (480, 640), the heights in metres
print(x3p.layers[0].points().shape) # (480, 640, 3), x, y and z in metres
print(x3p.metadata.instrument.model) # Scanner 3000
Documentation
- x3p Format: what an x3p file contains.
- Examples: a short script for each topic, in
the
examples/folder.
Command Line
x3pio info surface.x3p
x3pio convert -s xml surface.x3p surface_xml.x3p
x3pio convert -t int16 surface.x3p surface_int16.x3p
x3pio convert -r ISO5436_2000 surface.x3p surface_2000.x3p
convert changes the storage form (-s, xml or binary), the z data type (-t) and the
revision (-r) independently and repairs deviations of the source. With -f/--fix it drops
what cannot be written instead of failing: metadata without a date or a probing type, and vendor
extensions when converting to ISO 25178-72:2017. The command line also runs as python -m x3pio.
Development
python3 -m venv .venv # Windows: python -m venv .venv
source .venv/bin/activate # Windows (PowerShell): .venv\Scripts\Activate.ps1
pip install -e . --group dev
pre-commit install
pytest
pre-commit run --all-files
pip-audit
References
Metadata
Release files for x3pio 2.0.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 | |
|---|---|---|---|
| x3pio-2.0.0.tar.gz | 2.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| x3pio-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.1 MB
Release files / x3pio-2.0.0.tar.gz
| Download URL | x3pio-2.0.0.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc64002605c7ed95f8d4531822b9f154b1ae0569f1cb224ac8ce6f99a15b3842
|
|
BLAKE2b-256 checksum How to use checksums |
77fa0670a311bb11507b31eff83a96309d21f232ca177c5f95800bbdc7cad3cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 16, 2026.
Transparency logRelease files / x3pio-2.0.0-py3-none-any.whl
| Download URL | x3pio-2.0.0-py3-none-any.whl |
|---|---|
| Size | 79.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72621827b13fa930d35cef419a00b82f22677925f5d0ead24fc149b129fd04a3
|
|
BLAKE2b-256 checksum How to use checksums |
8f60b352cac6f636d551ec84fbc78a37834abe70ab22a4b8bf6f2d335de9abcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 16, 2026.
Transparency log