Skip to main content

Python: Rivian API Client

Currently a Work In Progress

Dependencies

uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Setup

Install project dependencies into the uv virtual environment and run pre-commit

uv sync --all-extras
pre-commit install

Run Tests

uv run pytest

Parallax

subscribe_for_parallax_messages streams the vehicle's Parallax RVM topics, whose payloads are protobuf. rivian.parallax decodes them into dicts keyed like the GraphQL vehicle state where a matching property exists:

from rivian import parallax


def on_message(data):
    if decoded := parallax.decode_parallax_subscription_message(data):
        print(decoded)

parallax.PARALLAX_RVMS lists every topic with a decoder, and parallax.CHARGING_RVMS the ones relevant to a charging session.

The schemas in src/rivian/parallax/proto/*.proto are reverse-engineered. After editing one, regenerate its *_pb2 modules (don't edit those by hand):

uv run python -m grpc_tools.protoc --proto_path=src --python_out=src \
    --pyi_out=src src/rivian/parallax/proto/*.proto

Commands

send_parallax_command sends a signed command, such as unlocking (parallax.UNLOCK_RVM with parallax.encode_unlock(); LOCK_RVM and encode_lock() to lock), and subscribe_for_parallax_command_state follows it. Subscribe first, then send:

import uuid

from rivian import parallax


def on_state(data):
    if state := parallax.decode_command_state_message(data):
        print(state["progress"], state["status"], state["error"])


command_id = str(uuid.uuid4())
unsubscribe = await rivian.subscribe_for_parallax_command_state(
    vehicle_id, command_id, on_state
)
if unsubscribe:
    await rivian.send_parallax_command(
        vehicle_id,
        parallax.UNLOCK_RVM,
        parallax.encode_unlock(),
        identity_id=identity_id,
        vehicle_key=vehicle_key,
        private_key=private_key,
        command_id=command_id,
    )
    ...  # wait for the progress "complete", or give up
    await unsubscribe()

The keys are those of send_vehicle_command. The command is done when the progress is complete, the status success and there is no error. If you never see that, check the vehicle before sending it again. This unlocks a real vehicle, so keep the keys secret.

Metadata

Release files for rivian-python-client 2.4.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 rivian-python-client 2.4.0
File Size Uploaded Provenance Actions
rivian_python_client-2.4.0.tar.gz 130.4 kB Without provenance Details for rivian_python_client-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rivian-python-client 2.4.0
File Interpreter ABI Platform Actions
rivian_python_client-2.4.0-py3-none-any.whl Python 3 none any Details for rivian_python_client-2.4.0-py3-none-any.whl

Total release size: 314.4 kB

Release files / rivian_python_client-2.4.0.tar.gz

Download URL rivian_python_client-2.4.0.tar.gz
Size 130.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b23ae53c538745d426ecf83aecc26c3a0f08a2064607778bc702b171b2ef863f
BLAKE2b-256 checksum
How to use checksums
e0c231813cd48d161f2b3765267cc2f1c15f587248c897de958366f011d71b3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rivian_python_client-2.4.0-py3-none-any.whl

Download URL rivian_python_client-2.4.0-py3-none-any.whl
Size 184.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
708fec5ed7e55d3927c9f139d9cabb745a175e524e1b7ef31b128832464ef5c4
BLAKE2b-256 checksum
How to use checksums
ba1a8ee1a779c14ba8a2f3f0418bd77eb61b865773717d9e930f9fcc049502f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for rivian-python-client 2.4.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.

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.

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files No provenance

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