How tdorssers/teslapy works
TeslaPy is a Python client for Tesla’s Owner API, with CLI, menu, and desktop GUI front ends. The main workflow is user authentication through Tesla SSO, token reuse/refresh, product discovery, and product-specific data retrieval or commands; vehicle telemetry can also arrive over a streaming connection. The library additionally supports battery and solar products, charging history/sites, vehicle metadata, and configurable authentication/cache behavior. The core excerpt is partial, so some internal links and product details are represented only where the README documents them; unsampled behavior is not inferred.
Main entry points: __init__.py Tesla session · cli.py CLI · gui.py Desktop GUI · menu.py Console menu
Components 22
User interfaces
- CLI
cli.py - Desktop GUI
gui.py - Console menu
menu.py
Authentication and transport
- Tesla session
teslapy/__init__.py - SSO and tokens
teslapy/__init__.py - Token cache
teslapy/__init__.py - HTTP transport
teslapy/__init__.py
Tesla products
- Endpoint catalog
teslapy/endpoints.json - Product objects
teslapy/__init__.py - Battery and solar data
teslapy/__init__.py
Vehicle capabilities
- Vehicle data and status
teslapy/__init__.py - Vehicle commands
teslapy/__init__.py - Vehicle streaming
teslapy/__init__.py - Option and VIN data
teslapy/__init__.py - Option descriptions
teslapy/option_codes.json - Charging and service
teslapy/__init__.py
Other components
- CLI user
- GUI user
- Menu user
- Tesla SSO
- Tesla Owner API
- Vehicle streaming
Connections 24
- CLI user → CLI: uses
cli.py - GUI user → Desktop GUI: uses
gui.py - Menu user → Console menu: uses
menu.py - CLI → Tesla session: creates session
cli.py - Desktop GUI → Tesla session: uses session
gui.py - Console menu → Tesla session: creates session
menu.py - Tesla session → SSO and tokens: manages auth
teslapy/__init__.py - SSO and tokens → Tesla SSO: requests tokens
README.md - SSO and tokens → Token cache: loads and saves
teslapy/__init__.py - Tesla session → HTTP transport: sends requests
teslapy/__init__.py - HTTP transport → Tesla Owner API: calls API
README.md - Tesla session → Endpoint catalog: loads endpoints
teslapy/__init__.py - Tesla session → Product objects: discovers products
cli.py - Product objects → Vehicle data and status: provides vehicle methods
README.md - Product objects → Battery and solar data: provides product methods
cli.py - Vehicle data and status → Tesla Owner API: requests vehicle data
README.md - Vehicle commands → Tesla Owner API: sends commands
README.md - Vehicle streaming → Vehicle streaming: subscribes telemetry
teslapy/__init__.py - Vehicle streaming → Vehicle data and status: updates vehicle
README.md - Option and VIN data → Option descriptions: looks up codes
teslapy/__init__.py - Charging and service → Tesla Owner API: requests details
README.md - CLI → Vehicle commands: invokes commands
cli.py - Console menu → Vehicle commands: invokes commands
menu.py - Desktop GUI → Vehicle data and status: refreshes dashboard
gui.py