Skip to main content

Tesla API Client

Project description

tesla_client

This library allows access to the unofficial Tesla API for reading data and issuing commands to Tesla vehicles.

A key feature of this library is that it offers an easy way to sync OAuth credentials with a data store of your choice. Credentials are auto-saved on login, or during token refreshes.

Quick Start

import tesla_client

tesla_client.init(CLIENT_ID, CLIENT_SECRET)  # Get these values from https://pastebin.com/pS7Z6yyP

# Define an Account subclass of your own to manage OAuth credential storage
class MyTeslaAccount(tesla_client.Account):
    def get_credentials(self):
        return your_credentials_store.get()

    def save_credentials(self, creds):
        your_credentials_store.save(creds)


account = MyTeslaAccount()

# Log in (and automatically save the OAuth credentials)
account.login('mrsteven@gmail.com', 'password')

# Access a vehicle in this account
vehicle = account.get_vehicles()[0]

# Fetch some data from the vehicle
vehicle.data_request('drive_state')

# Send a command to the vehicle
vehicle.command('honk_horn')

The Tesla API is not officially supported by Tesla, Inc. It may stop working at any time. For detailed documentation of API commands, see https://tesla-api.timdorr.com/. Thanks to Tim Dorr for his work in documenting the unofficial API.

Tesla, Inc. does not endorse or support this python library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tesla_client-1.0.4.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tesla_client-1.0.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file tesla_client-1.0.4.tar.gz.

File metadata

  • Download URL: tesla_client-1.0.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.12.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3

File hashes

Hashes for tesla_client-1.0.4.tar.gz
Algorithm Hash digest
SHA256 87b4755cab55307b850b2b7495d8e41697c84ef3f1abb10a7c24ed869669e5d0
MD5 c499016311a4a4f686467f150e36aabe
BLAKE2b-256 cf6b0b2707d60884e8350165e510bbf077e04ac6c07ac411fee0431e66b759fc

See more details on using hashes here.

File details

Details for the file tesla_client-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: tesla_client-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.12.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3

File hashes

Hashes for tesla_client-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2261cdcd6b4f2f951818b2af2ab749a69007cfa34b81e38665761f32a6c4ac34
MD5 8139a2efbf743f04bce7c9ef8631f8af
BLAKE2b-256 1ffd72958dc669915b3485b3d1e51bd918a2855331078adc8c568fe519124273

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page