Skip to main content

pygeocover

Client Python asynchrone (aiohttp) non officiel pour l'API grand public Decathlon Geocover (plateforme Conneqtech), destiné à l'intégration Home Assistant.

Installation locale

python3 -m pip install --user -e ".[test]"

Ligne de commande

Configuration : geocover.json dans le dossier courant (ou --config, ou $PYGEOCOVER_CONFIG), créé au premier login et contenant vos jetons. Fichier privé, ignoré par git.

python3 -m pygeocover login          # connexion (voir ci-dessous)
python3 -m pygeocover                # état : position, batterie, santé, dernier trajet
python3 -m pygeocover rides 10       # 10 derniers trajets
python3 -m pygeocover locations 24   # positions des dernières 24 h

Connexion

Le navigateur s'ouvre sur la connexion Decathlon. À la fin, une page Conneqtech « Whoops! Looks like something went wrong » s'affiche : c'est voulu. Copiez son adresse (https://login.ids.conneq.tech/redirect?code=…) et collez-la dans le terminal rapidement. Explication technique dans auth.py.

Utilisation en Python

import aiohttp
from pygeocover import GeocoverClient, TokenSet

async with aiohttp.ClientSession() as session:
    client = GeocoverClient(session,
                            TokenSet.from_dict(saved),          # ou None avant connexion
                            on_tokens_updated=persist)          # OBLIGATOIRE : refresh_token rotatif
    # connexion : req = await client.async_start_login(); ouvrir req.url ;
    #             await client.async_finish_login(req, url_collee)
    bikes = await client.async_get_bikes()   # position + batterie + odomètre + géofences
Méthode Endpoint
async_get_user() GET user/me
async_get_bikes() / async_get_bike(id) GET bike, GET bike/{id}
async_get_locations(id, start, end) GET bike/{id}/location?from=&till= (ISO 8601)
async_get_battery(id) GET bike/{id}/battery/current-state
async_get_state(id) GET bike/{id}/state
async_get_health(id) GET bike/{id}/health
async_get_geofences(id) GET bike/{id}/geofence
async_get_rides(id, limit, offset) / async_get_latest_ride(id) GET v2/bike/{id}/ride

Exceptions (toutes dérivées de GeocoverError) :

  • GeocoverAuthError : reconnexion nécessaire (refresh_token refusé : invalid_grant, 401, 403) ;
  • GeocoverConnectionError : serveur injoignable ou délai dépassé (transitoire) ;
  • GeocoverApiError : réponse d'erreur HTTP ; attributs status, error (code OAuth), retry_after (secondes, d'après l'en-tête Retry-After) ;
  • GeocoverRateLimitError (sous-classe de GeocoverApiError) : HTTP 429 ;
  • GeocoverResponseError : réponse au format inattendu (changement d'API ?) ;
  • GeocoverLoginError : connexion impossible (code expiré, adresse collée invalide).

GeocoverClient(..., language="fr") règle l'en-tête Accept-Language.

Points d'attention

  • refresh_token rotatif à usage unique : chaque rafraîchissement l'invalide ; le client appelle on_tokens_updated à chaque nouveau jeton, l'appelant doit le persister immédiatement. Un même refresh_token ne doit être utilisé que par un seul programme à la fois.
  • Accept: application/json obligatoire (sinon HTTP 406) — géré par le client.
  • Trajets : tri par order=start_date;desc (syntaxe champ;sens trouvée dans l'APK, service n1) ; sans ce paramètre le serveur renvoie du plus ancien au plus récent. Filtres (non utilisés) au format filter[]=or;bike_id;eq;<id>.
  • client_id / client_secret : ceux de l'app Android, identiques pour tous ses utilisateurs, inclus par défaut (secret « non confidentiel » au sens de la RFC 8252 §8.5). Surchargeables.

Tests

PYTHONPATH=src python3 -m pytest -q

Metadata

Release files for pygeocover 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygeocover 0.2.0
File Size Uploaded Provenance Actions
pygeocover-0.2.0.tar.gz 20.9 kB With provenance Details for pygeocover-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygeocover 0.2.0
File Interpreter ABI Platform Actions
pygeocover-0.2.0-py3-none-any.whl Python 3 none any Details for pygeocover-0.2.0-py3-none-any.whl

Total release size: 39.4 kB

Release files / pygeocover-0.2.0.tar.gz

Download URL pygeocover-0.2.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d42d6ba9217d181c20a7dd1ed4304d84fc48d1ae960e6b3561d040a23c62def0
BLAKE2b-256 checksum
How to use checksums
f1461f89cc38eaaa4146731bbd75f47e95a02990206e5c4007cbe7944b8fb013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / pygeocover-0.2.0-py3-none-any.whl

Download URL pygeocover-0.2.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
266a15f51dc1f16d0cbb3b05f029e6c3ec870d101851310777be8636a23cff70
BLAKE2b-256 checksum
How to use checksums
aa217a5d57260c1fcd3195fbdb2065a81b1845843bc0de60b711ac03d1597590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for pygeocover 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pygeocover-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page