Registry / http-networking / teslajsonpy

teslajsonpy

JSON →
library3.13.2pypypi✓ verified 81d ago

A Python library to interact with the Tesla API. It provides async access to vehicle data, controls (climate, charging, etc.), and energy products like Powerwall and solar. The current stable version is 3.13.2, supporting Python >=3.7. Release cadence is irregular, with several patches per year.

pip install teslajsonpy
INSTALL
IMPORT
SIG · TESLAJSONPY
T
teslajsonpy
http-networkingpythonv3.13.2
Install
7.1s avg
Import
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.13.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 46.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.1s · import 0.000s · 49MB
47MB installed
● package 47MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Connection
from teslajsonpy import Connection
from teslajsonpy import Tesla
Controller
from teslajsonpy import Controller
TeslaCar
from teslajsonpy import TeslaCar

Connects to Tesla API and lists available vehicles. Requires TESLA_EMAIL and TESLA_PASSWORD environment variables.

import asyncio from teslajsonpy import Tesla import os async def main(): email = os.environ.get('TESLA_EMAIL', '') password = os.environ.get('TESLA_PASSWORD', '') tesla = Tesla(email, password) await tesla.connect() vehicles = await tesla.vehicles() for v in vehicles: print(f'Vehicle: {v.display_name}, VIN: {v.vin}') await tesla.disconnect() asyncio.run(main())
Debug
Known issues
breakingVersion 3.x switched from synchronous to async API. All method calls must be awaited.
fix
Use async/await syntax and import from teslajsonpy (not teslajsonpy2).
affects: >=3.0.0
gotchaTesla API tokens expire after 45 days. The library does not automatically refresh; you must re-authenticate by calling connect() again.
fix
Periodically call await tesla.connect() before expiry, or catch token errors and re-authenticate.
affects: all
gotchaDo not reuse a Tesla account with different API clients (e.g., both teslajsonpy and another app) - it can cause token invalidation.
fix
Use separate Tesla accounts for different integrations, or implement token sharing with care.
affects: all
Upgrade
Version history
3.13.2latest on PyPI · released Sep 26, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
teslajsonpy — pip install teslajsonpy · libregistry