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.2.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.2.0
File Size Uploaded Provenance
retp-0.2.0.tar.gz 357.0 kB With provenance Details

Built distributions (wheels)

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

Total release size: 373.7 MB

Release files / retp-0.2.0.tar.gz

Download URL retp-0.2.0.tar.gz
Size 357.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2d6ee4ffbbecddf44252fe778bb9dd46515e7b4a29f775c8df632eeddddd8325
BLAKE2b-256 checksum
How to use checksums
a18e78e52bc4c1fb159f6b1962e66e1ef9983a81315f746e4fdd2ec8019cc02b
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 15, 2026.

Transparency log

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

Download URL retp-0.2.0-cp39-abi3-win_arm64.whl
Size 40.8 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
e90adb4ec5f2da600c4fbbbbe974e704577dc14cbc9aaefccf4e5b5fc2f1c000
BLAKE2b-256 checksum
How to use checksums
43c42c90b2e0736640810b98d47b264d4ccd9247386c479dafa552076e7c1341
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 15, 2026.

Transparency log

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

Download URL retp-0.2.0-cp39-abi3-win_amd64.whl
Size 43.5 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
57432a9225ba311e8b838e8bd8fccf7cc319a8e3057cdb26a898b442ab3d52a5
BLAKE2b-256 checksum
How to use checksums
586004c0713dfcb10656c06a5fc5f3818132628aaa734a6ff18db54bcdc60f38
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 15, 2026.

Transparency log

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

Download URL retp-0.2.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 52.3 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
265b7e0d928c61da31cdc89b513b3143fe43a169d14820529edc4c949d6023d3
BLAKE2b-256 checksum
How to use checksums
6262b47d0ee1fbea340003c8a2396e2f01ba4f1e99034ff092d6bd6df382d212
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 15, 2026.

Transparency log

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

Download URL retp-0.2.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 52.6 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
4d27123f372c111df9e7cc0d157ce0251219d55dfb144b3b1bc02b91364f4eb5
BLAKE2b-256 checksum
How to use checksums
d3a536615042e3bbf0ab732a6a7c8e012310959aa0fb7792060d2c0c9558cd0f
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 15, 2026.

Transparency log

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

Download URL retp-0.2.0-cp39-abi3-manylinux_2_28_x86_64.whl
Size 47.6 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
d4fe1a615be52507a06adbd32598419a4f5aa867ffbfd368ca68bd5ea3381a83
BLAKE2b-256 checksum
How to use checksums
090cf64d605c75e4d021a237f2cd4d1734c8a794862e9336b4525c598840bcb2
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 15, 2026.

Transparency log

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

Download URL retp-0.2.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 52.6 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
e6ec11a551795f4112757913484fb5020fb9df4789afbbdaa21748bd293e52a2
BLAKE2b-256 checksum
How to use checksums
4123c944f391cc7246c9ca81170a52058140754f9c8984f8f1efc6c3c4ae939a
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 15, 2026.

Transparency log

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

Download URL retp-0.2.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
7a6745b9598fd342e6866c6eccc7757c4aaa01c067dfdf499d6ff1699035cf47
BLAKE2b-256 checksum
How to use checksums
c2182055ff0e0e2ab76621fcc289d58ffd6b683fdd9be89d65bc6e20425777f4
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 15, 2026.

Transparency log

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

Download URL retp-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 41.6 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c2a4dd9db23c509a9e8635f8c82e2b133e3f7081ba381ad049a81c304b3c58b9
BLAKE2b-256 checksum
How to use checksums
7f9b30bb95f3539d3f4e2546f2d8a664e62154905b40183b656b005700660413
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 15, 2026.

Transparency log

Security for retp 0.2.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.2.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 15, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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