Skip to main content

A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.

Project description

PyCupra

A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.

Fork of https://github.com/Farfar/seatconnect which in turn is a fork of: Fork of https://github.com/lendy007/skodaconnect which in turn is a fork of: https://github.com/robinostlund/volkswagencarnet

Information

Retrieve statistics about your Cupra/Seat from the Cupra/Seat Connect online service

No licence, public domain, no guarantees, feel free to use for anything. Please contribute improvements/bugfixes etc.

Breaking changes

  • The method vehicle.update(updateType) supports 3 different update types:

    • updateType=0: Small update (=only get_basiccardata() and get_statusreport are called). If the last full update is more than 1100 seconds ago, then a full update is performed.
    • updateType=1: Full update (nearly all get-methods are called. The model images and the capabilitites are refreshed only every 2 hours.)
    • updateType=2: Like updateType=0, but ignoring the nightly update reduction
  • Nightly update reduction: If nightly reduction is activated and the current time is within the time frame between 22:00 and 05:00, then vehicle.update(0) performs a full update, if the last full update is more than 1700 seconds ago. If that's not the case, vehicle.update(0) does nothing.

  • PyCupra can ask the Seat/Cupra portal to send push notifications to PyCupra if the charging status or the climatisation status has changed or when the API has finished a request like lock or unlock vehicle, start or stop charging or change departure timers or ....

Thanks to

  • RobinostLund for initial project for Volkswagen Carnet I was able to fork
  • Farfar for modifications related to electric engines
  • tanelvakker for modifications related to correct SPIN handling for various actions and using correct URLs also for MY2021
  • sdb9696 for the firebase-messaging package that is used in PyCupra with only minor modifications

Example

For an extensive example, please use the code found in example/PyCupra.py. When logged in the library will automatically create a vehicle object for every car registered to the account. Initially no data is fetched at all. Use the doLogin method and it will signin with the credentials used for the class constructor. After a successful login, the tokens are stored in a json file. Later doLogin calls can use the token file instead of the credentials. Method get_vehicles will fetch vehicle basic information and create Vehicle class objects for all associated vehicles in account. To update all available data use the update_all method of the Connect class. This will call the update function for all registered vehicles, which in turn will fetch data from all available API endpoints.

The file pycupra_credentials.json.demo explains the data structure of the credentials file.

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

pycupra-0.1.9.tar.gz (93.1 kB view details)

Uploaded Source

Built Distribution

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

pycupra-0.1.9-py3-none-any.whl (89.2 kB view details)

Uploaded Python 3

File details

Details for the file pycupra-0.1.9.tar.gz.

File metadata

  • Download URL: pycupra-0.1.9.tar.gz
  • Upload date:
  • Size: 93.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for pycupra-0.1.9.tar.gz
Algorithm Hash digest
SHA256 67b1eb89106c089741dd03bd9c8b1b1dd8d08ba98643a66b7b07b9f630c97fcc
MD5 894d61344b226f16ab553ae829c0a41b
BLAKE2b-256 e899c827d53e2365b43222246dc429a00d486960f739294152d6cb4ecbc5ba27

See more details on using hashes here.

File details

Details for the file pycupra-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: pycupra-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 89.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for pycupra-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c94f36928a370e61a74d8aa5410b084b33f1eaeeb69f8fd17b156da0b8f2cd99
MD5 b2a5e3638debdd7dceb395c5b34b1d62
BLAKE2b-256 c7c543e5c14b89b6aead6005c4f804bfc96a3f9ff910691f5a1198344cd128c1

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