Skip to main content

python-lucidmotors

Unofficial Python bindings to the Lucid Motors API. No affiliation with Lucid Motors.

To install dependencies, assuming you have Python development tools already, run:

pip install -r requirements.txt

Try fiddling with examples/vehicle_info.py. With no arguments it will prompt for your Lucid username and password, then print out your user profile and vehicle information.

To generate a test case from your data, visit testmycode.cc. This will log in using your Lucid account, remove identifying information from the API response, and let you submit the anonymized data for review.

Authentication and session lifetime

A successful login or refresh returns three credentials, and they do not share a lifetime:

credential what it is lifetime
id_token the bearer attached to every gRPC call 5 minutes (exp − iat = 300 s)
gigya_jwt stored on the session, not used for calls 6 hours
refresh_token opaque; mints a new session via authentication_refresh() does not rotate; server-side expiry unknown

LucidAPI.session_time_remaining tracks the id_token, so it will read as five minutes even though gigya_jwt is longer. The server enforces the id_token expiry exactly — a call made 45 seconds past exp fails with UNAUTHENTICATED: token is expired by 45s, with no grace period.

Two consequences for anything long-running:

  • Refresh before session_time_remaining reaches zero, and make your threshold larger than your poll interval. A client polling every 30 s should refresh at roughly < 60 s remaining.
  • Don't refresh more often than that. Back-to-back calls to authentication_refresh() return the same session and expiry until it is genuinely near the end, so a threshold that is always true (for example < 3600 against a 300 s token) just refreshes on every poll for nothing.

login_with_refresh_token() lets a service start from a stored refresh token so no password needs to be kept on disk.

If you're feeling adventurous, try playing with examples/test_all_actions.py which will run through every action we have figured out out thus far. A "stress test" of sorts.

Metadata

Release files for lucidmotors 1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lucidmotors 1.4.2
File Size Uploaded
lucidmotors-1.4.2.tar.gz 140.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lucidmotors 1.4.2
File Interpreter ABI Platform
lucidmotors-1.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 341.5 kB

Release files / lucidmotors-1.4.2.tar.gz

Download URL lucidmotors-1.4.2.tar.gz
Size 140.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6244b97b9a32a172ac5b19d087428df5c468d77f719cddee37df7cffb9c47187
BLAKE2b-256 checksum
How to use checksums
f43ea545e3323d8f2988a94f370d20250cbc4105ab5c1c6cdbb07f6149ed5648
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / lucidmotors-1.4.2-py3-none-any.whl

Download URL lucidmotors-1.4.2-py3-none-any.whl
Size 201.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77737962d012fb4962d69500ae19ab6c71217d8625a9780dfdc8ada862d63cd0
BLAKE2b-256 checksum
How to use checksums
ce6f6a4c5c81f2cf5e5a6e5b27f2d55cafdae18b584cd73be649f546857640da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.4.2 This release

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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