Skip to main content

Library for interaction with the MySkoda APIs.

Project description

Version PyPi Downloads PyPi Docs Discord Coverage Status

MySkoda

MySkoda is an async Python library to interact with the Skoda API.

MySkoda is primarily developed to be used by the https://github.com/skodaconnect/homeassistant-myskoda project, a Home Assistant integration for Skoda vehicles.

Before updating please review the release notes.

Get In Touch

We have an active community in our discord. Feel free to join.

If you have any issues, please report them in our issue tracker.

Quick Start

The MySkoda package is published to Pypi and can be found here.

It can be installed the usual way:

pip install myskoda

Basic example

import asyncio
from aiohttp import ClientSession
from myskoda import MySkoda

USERNAME = "my.user@domain.com"
PASSWORD = "my_password"

async def main():
    async with ClientSession() as session:
        myskoda = MySkoda(session)
        await myskoda.connect(USERNAME, PASSWORD)
        for vin in await myskoda.list_vehicle_vins():
            print(vin)
        await myskoda.disconnect()

asyncio.run(main())

or if you have an oidc2.0 refresh token available:

import asyncio
from aiohttp import ClientSession
from myskoda import MySkoda

TOKEN = "ey..."

async def main():
    async with ClientSession() as session:
        myskoda = MySkoda(session)
        await myskoda.connect_with_refresh_token(TOKEN)
        for vin in await myskoda.list_vehicle_vins():
            print(vin)
        await myskoda.disconnect()

asyncio.run(main())

Documentation

Detailed documentation is available at read the docs:

As Library

MySkoda relies on aiohttp which must be installed. A ClientSession must be opened and passed to MySkoda upon initialization.

After connecting, operations can be performed, events can be subscribed to and data can be loaded from the API.

Don't forget to close the session and disconnect MySkoda after you're done.

As CLI

The MySkoda package features a CLI. You will have to install it with extras cli:

pip install "myskoda[cli]"

Afterwards, the CLI is available in your current environment by invoking myskoda.

Username and password must be provided to the CLI for every request as options, before selecting a sub command:

myskoda --user "user@example.com" --password "super secret" list-vehicles

Help can be accessed the usual way:

myskoda --help

Contribute your Fixtures

Please contribute fixtures for our tests by running this command:

# Export all endpoints for all vehicles.
myskoda \
    --user user \
    --password password \
    gen-fixtures \
        --name my_cars \
        --description "My cars in no specific state."
        --vehicle all \
        get all

It is also possible to just contribute a single vehicle:

# Export all endpoints for a specific vehicle.
myskoda \
    --user user \
    --password password \
    gen-fixtures \
        --name my_favorite_car \
        --description "My favorite car in no specific state."
        --vehicle TMOCKAA0AA000000 \
        get all

Or even narrow down to an inidividual endpoint for an individual vehicle:

# Export a specific endpoint for a specific vehicle.
myskoda \
    --user user \
    --password password \
    gen-fixtures \
        --name my_favorite_car_info \
        --description "Info for my favorite car in no specific state."
        --vehicle TMOCKAA0AA000000 \
        get info

This will call all the selected get-routes and load all data from your vehicles (no actions will be performed).

The data will be anonymized (vin and personal data are replaced) and serves as unit tests.

Please create a pull request with the resulting data to help us cover more vehicles.

Disclaimer

This project is an unofficial API client for the Skoda API and is not affiliated with, endorsed by, or associated with Skoda Auto or any of its subsidiaries.

Use this project at your own risk. Skoda Auto may update or modify its API without notice, which could render this client inoperative or non-compliant. The maintainers of this project are not responsible for any misuse, legal implications, or damages arising from its use.

Ensure compliance with Skoda Auto's terms of service and any applicable laws when using this software.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

myskoda-2.5.2.tar.gz (341.0 kB view details)

Uploaded Source

Built Distribution

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

myskoda-2.5.2-py3-none-any.whl (70.0 kB view details)

Uploaded Python 3

File details

Details for the file myskoda-2.5.2.tar.gz.

File metadata

  • Download URL: myskoda-2.5.2.tar.gz
  • Upload date:
  • Size: 341.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.9

File hashes

Hashes for myskoda-2.5.2.tar.gz
Algorithm Hash digest
SHA256 e0c9d4c9953136599ba8a26cdf85b605c7209bc8e8e5e4429d974301afabb50d
MD5 d348e52a09beb0789846fc6b0af3d4f6
BLAKE2b-256 2bd4869e079c23478c9ecf53777b5c88144edc7321f8523b0823604293561c68

See more details on using hashes here.

File details

Details for the file myskoda-2.5.2-py3-none-any.whl.

File metadata

  • Download URL: myskoda-2.5.2-py3-none-any.whl
  • Upload date:
  • Size: 70.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.9

File hashes

Hashes for myskoda-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9de76df9f046fa403d450a50c8a6a0aab09d663b4161cd53875ce1f1ff69f0a6
MD5 43682149902961deb91cd56cf8708b92
BLAKE2b-256 a8c6d5e0b69f33ce3c67b0bc76649da526b2ee18a26dcfaa5163df73e96c1d3d

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