Skip to main content

retp (Python)

An ETP v1.2 client for Python, over the Rust retp stack: open a session with an ETP server, list its dataspaces and resources, read and write EnergyML objects, read data arrays into numpy.

import retp

with retp.connect("wss://etp.example.org/", token=token) as session:
    for space in session.dataspaces():
        print(space["path"], space["uri"])

    listed = session.resources("demo")
    objects, errors = session.get_objects([r["uri"] for r in listed["resources"]])

    values, dimensions = session.read_array(uri, "/RESQML/.../points")
    points = values.reshape(dimensions)

It is only a bridge. Every operation is a call into the Rust library (retp-client, energyml-etp-store); the Python layer converts arguments and results and carries no feature the Rust library does not have. What Python needs and Rust lacks is added in Rust first.

Objects are dictionaries, in the EnergyML JSON encoding: every node carries its $type. No generated classes. This is the same convention as energyml-rust's Python bridge (energyml.rust), so an object read here can be put there, and the other way round.

Arrays are numpy arrays, copied out of the Rust buffer, flat and row-major, with the dimensions beside them.

A failure is named. Exceptions derive from retp.RetpError and tell apart what a caller does differently: reconnect (ConnectionLost), log in again (AuthorizationNeeded), check before retrying a write (OutcomeUnknown), give up on a feature (Unsupported). A call never returns an empty result to mean "not supported".

The token is never stored: it is handed to the Rust client and is in no repr, no attribute and no error message.

Status: first draft, alpha. See DESIGN.md for the scope, the decisions still open, and what the Rust API must grow before the bridge can offer more. See ARCHITECTURE.md for why the code is shaped as it is, and docs/python.md (at the root of the repository) for the user guide.

Install

pip install retp

TODO(verify): not published to PyPI yet. From a checkout of the repository (needs the HDF5 C library, or add hdf5-static to the features for CMake and a C compiler instead):

pip install maturin
cd crates/retp-python
maturin develop

License

Apache-2.0.

Metadata

Release files for retp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for retp 0.3.0
File Size Uploaded Provenance
retp-0.3.0.tar.gz 390.6 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for retp 0.3.0
File
retp-0.3.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
retp-0.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
retp-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
retp-0.3.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
retp-0.3.0-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
retp-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
retp-0.3.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
retp-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 378.0 MB

Release files / retp-0.3.0.tar.gz

Download URL retp-0.3.0.tar.gz
Size 390.6 kB
Tags Source
SHA-256 checksum
How to use checksums
95fd2b8bde17f3eb41f986e97cc21089bcaa144584ef7211e568555e32997475
BLAKE2b-256 checksum
How to use checksums
f5bdc2ad1b24426c396807ff714a165c5d39da7323a55123238ccf3a73040dc8
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

Release files / retp-0.3.0-cp39-abi3-win_arm64.whl

Download URL retp-0.3.0-cp39-abi3-win_arm64.whl
Size 41.3 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
ecf7830339e3ff571aca1951986150cdb9926984921760e30b8f2e34763d1b37
BLAKE2b-256 checksum
How to use checksums
da4303bf1e088cad00219c66993a6f64b9aeb61abfe38d3dced82feff052be4d
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

Release files / retp-0.3.0-cp39-abi3-win_amd64.whl

Download URL retp-0.3.0-cp39-abi3-win_amd64.whl
Size 44.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5dbf0936f3ba84ab688214145745ff227b09cc3a9a37c50edf558174bc3cec19
BLAKE2b-256 checksum
How to use checksums
04426e09d4e30c5701b3a7b1fe70d7e247ea5c18120b1abe9fe2b61cbc49e81d
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

Release files / retp-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL retp-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 53.0 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
ecd93785900d48d6ddd6868ad713c8aa9e56f23c3e3c835c8f25dacf066e3725
BLAKE2b-256 checksum
How to use checksums
85eecd1a04fde8c0f4cf3e47e09df9f0b289f40e44eac1844c2c19a52e7bbe54
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

Release files / retp-0.3.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL retp-0.3.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 53.3 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
3f8b1a12ba2be249ca47bbf5721530a058c6ec340704811a261ecd57cf09ddbd
BLAKE2b-256 checksum
How to use checksums
ba9584e4bf98fca5c757058ba67309a39295ef0a3cbe1e26d125397e9a0de9ca
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

Release files / retp-0.3.0-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL retp-0.3.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 48.2 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
9e7e043564987f08b72477c7dc39772d1e4040fd6fbec21b9541b2c5eb7cf30c
BLAKE2b-256 checksum
How to use checksums
b899097bf6afd21365648e81c3b7c2f10f216057d74a28e86e8f7b99dead3ab3
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

Release files / retp-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL retp-0.3.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 53.3 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
67dcd451a507f34144614b6e91597512a9d0bbaa7587391e8ae5dd6a28ef1951
BLAKE2b-256 checksum
How to use checksums
f79cd21e36c0a5a980ed593a6a06d84516a59c431342d27cd2112c17d34c2bd3
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

Release files / retp-0.3.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL retp-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
Size 42.3 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
99588e51e7d180b1014dfd3045ffa82126a8fc7ecf1b71aeadc2b7e45f9ac7ba
BLAKE2b-256 checksum
How to use checksums
92de5f412bbd96459f456c9aabbcdac948f09aa981ffde157a33f0d1f7fbb2fe
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

Release files / retp-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL retp-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 42.1 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d6e690bbf2a01e796db2cc1f98ea045d4fe34c8706f706b66836e1c09f4926c6
BLAKE2b-256 checksum
How to use checksums
def48c6c8b4c97ba97f59b6f67afdab856b4f3c2a9bf5b4b71d972a5427798ed
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

Security for retp 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.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for retp-0.3.0.tar.gz

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

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page