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.1

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.1
File Size Uploaded Provenance Actions
rivian_python_client-2.4.1.tar.gz 130.4 kB Without provenance Details for rivian_python_client-2.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 314.5 kB

Release files / rivian_python_client-2.4.1.tar.gz

Download URL rivian_python_client-2.4.1.tar.gz
Size 130.4 kB
Tags Source
SHA-256 checksum
How to use checksums
adaa664a1e889efa8a4df2fb49d3d509e6a62e21367f06d28c072b7771ce10d6
BLAKE2b-256 checksum
How to use checksums
e666eb46701dc6b532e7c4ecd535891376d488d7e7411414acf8bd409ec3a50b
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.1-py3-none-any.whl

Download URL rivian_python_client-2.4.1-py3-none-any.whl
Size 184.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81b1499fe9639155a76a07c65627b24a169b0bb27e714761e43d6809bf11c937
BLAKE2b-256 checksum
How to use checksums
f25c3a26f9b4eb0ff44e1d502ae7d721cc52e36ba63bb8bfccdd7d1f93f04548
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.1

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.1 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