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.6.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.6.0
File Size Uploaded Provenance Actions
rivian_python_client-2.6.0.tar.gz 140.3 kB Without provenance Details for rivian_python_client-2.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 334.9 kB

Release files / rivian_python_client-2.6.0.tar.gz

Download URL rivian_python_client-2.6.0.tar.gz
Size 140.3 kB
Tags Source
SHA-256 checksum
How to use checksums
48af3df68c6342a4a1b8f7ee0f728282f5af53e6b4f00326b0facca9a100c657
BLAKE2b-256 checksum
How to use checksums
28cc373727826ed2940cceb574ef8456229a6004ce6553355214454446f5cc08
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.6.0-py3-none-any.whl

Download URL rivian_python_client-2.6.0-py3-none-any.whl
Size 194.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee3a3ca03f2e4e955a871add5a9e2bffabedb1841676ba1562c169a6c253c821
BLAKE2b-256 checksum
How to use checksums
3ab7800817438b48b561c72c3619a8a1ad4ed0d3eeb623ee803c142f03160c45
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.6.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.6.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