Metadata-Version: 2.5
Name: rivian-python-client
Version: 2.3.1
Summary: Rivian API Client (Unofficial)
Author-email: Brian Retterer <bretterer@gmail.com>, "J.R. Gutierrez" <jrgutier@gmail.com>, Nathan Spencer <natekspencer@gmail.com>, Trevor Mack <drummer8001@gmail.com>
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: aiohttp>=3.0.0
Requires-Dist: cryptography>=41.0.1
Requires-Dist: protobuf<8,>=6.31.1
Provides-Extra: ble
Requires-Dist: bleak>=0.21; extra == 'ble'
Requires-Dist: dbus-fast>=2.11.0; (sys_platform == 'linux') and extra == 'ble'
Description-Content-Type: text/markdown

# Python: Rivian API Client

Currently a Work In Progress

## Dependencies

[uv](https://docs.astral.sh/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:

```python
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
```
