pygeocover 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pygeocover/__init__.py ADDED
@@ -0,0 +1,33 @@
1
+ """pygeocover — client asynchrone non officiel de l'API Decathlon Geocover (Conneqtech)."""
2
+ from .auth import LoginRequest, TokenSet
3
+ from .client import GeocoverClient
4
+ from .exceptions import (
5
+ GeocoverApiError,
6
+ GeocoverAuthError,
7
+ GeocoverConnectionError,
8
+ GeocoverError,
9
+ GeocoverLoginError,
10
+ )
11
+ from .models import BatteryState, Bike, BikeState, Geofence, Health, Location, Ride, RidePage, User
12
+
13
+ __version__ = "0.1.0"
14
+
15
+ __all__ = [
16
+ "BatteryState",
17
+ "Bike",
18
+ "BikeState",
19
+ "GeocoverApiError",
20
+ "GeocoverAuthError",
21
+ "GeocoverClient",
22
+ "GeocoverConnectionError",
23
+ "GeocoverError",
24
+ "GeocoverLoginError",
25
+ "Geofence",
26
+ "Health",
27
+ "Location",
28
+ "LoginRequest",
29
+ "Ride",
30
+ "RidePage",
31
+ "TokenSet",
32
+ "User",
33
+ ]
pygeocover/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ main()
pygeocover/auth.py ADDED
@@ -0,0 +1,154 @@
1
+ """Connexion OAuth2 + PKCE et jetons Conneqtech.
2
+
3
+ Seule redirect_uri autorisée pour le client de l'app : `tech.conneq.decathlon://…`,
4
+ qu'un navigateur de bureau ne sait pas ouvrir. On passe donc directement par l'IdP
5
+ Decathlon avec un `state` (même format que la page login.ids.conneq.tech) dont la
6
+ redirectURI n'est pas autorisée : au retour, la page
7
+ `https://login.ids.conneq.tech/redirect?code=…&state=…` échoue (« Whoops! ») AVANT
8
+ de consommer le code Decathlon. L'utilisateur colle cette URL, puis on fait nous-mêmes :
9
+ 1. POST /oauth (JSON, grant_type=idp_authorization_code) -> {code}
10
+ 2. POST /oauth (form, grant_type=authorization_code + code_verifier) -> jetons
11
+ """
12
+ from __future__ import annotations
13
+
14
+ import base64
15
+ import hashlib
16
+ import json
17
+ import secrets
18
+ import time
19
+ from dataclasses import asdict, dataclass
20
+ from typing import Any, Dict, Optional
21
+ from urllib.parse import parse_qs, urlencode, urlparse
22
+
23
+ from .const import APP_REDIRECT_URI, DEFAULT_CLIENT_ID, TOKEN_REFRESH_MARGIN, UNROUTABLE_REDIRECT_URI
24
+ from .exceptions import GeocoverLoginError
25
+
26
+
27
+ def _b64url(data: bytes) -> str:
28
+ return base64.urlsafe_b64encode(data).rstrip(b"=").decode()
29
+
30
+
31
+ @dataclass
32
+ class TokenSet:
33
+ access_token: str
34
+ refresh_token: str
35
+ expires_at: float # epoch (s)
36
+
37
+ @classmethod
38
+ def from_response(cls, data: Dict[str, Any], now: Optional[float] = None) -> "TokenSet":
39
+ now = time.time() if now is None else now
40
+ return cls(
41
+ access_token=data["access_token"],
42
+ refresh_token=data["refresh_token"],
43
+ expires_at=now + float(data.get("expires_in") or 0),
44
+ )
45
+
46
+ @classmethod
47
+ def from_dict(cls, data: Dict[str, Any]) -> "TokenSet":
48
+ return cls(
49
+ access_token=data.get("access_token") or "",
50
+ refresh_token=data["refresh_token"],
51
+ expires_at=float(data.get("expires_at") or 0),
52
+ )
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ return asdict(self)
56
+
57
+ def needs_refresh(self, now: Optional[float] = None) -> bool:
58
+ now = time.time() if now is None else now
59
+ return not self.access_token or self.expires_at - TOKEN_REFRESH_MARGIN <= now
60
+
61
+
62
+ @dataclass
63
+ class LoginRequest:
64
+ """Connexion en cours ; sérialisable (to_dict) pour être gardée entre deux étapes."""
65
+
66
+ url: str
67
+ state: str
68
+ code_verifier: str
69
+ code_challenge: str
70
+ nonce: str
71
+ client_id: str
72
+ issuer_id: str
73
+ idp_redirect_uri: str
74
+
75
+ @classmethod
76
+ def create(cls, settings: Dict[str, Any], client_id: str = DEFAULT_CLIENT_ID) -> "LoginRequest":
77
+ """`settings` = GET api.ids.conneq.tech/client/{client_id}/setting/loginpage."""
78
+ verifier = secrets.token_urlsafe(64)
79
+ challenge = _b64url(hashlib.sha256(verifier.encode()).digest())
80
+ nonce = secrets.token_urlsafe(16)
81
+ state = _b64url(json.dumps({
82
+ "client_id": client_id,
83
+ "redirectURI": UNROUTABLE_REDIRECT_URI,
84
+ "nonce": secrets.token_hex(3),
85
+ "state": secrets.token_urlsafe(16),
86
+ "appCodeChallenge": challenge,
87
+ "appCodeChallengeMethod": "S256",
88
+ "appNonce": nonce,
89
+ }, separators=(",", ":")).encode())
90
+ idp_uri = settings["idp_uri"]
91
+ url = idp_uri + ("&" if "?" in idp_uri else "?") + urlencode({
92
+ "client_id": settings["idp_client_id"],
93
+ "redirect_uri": settings["idp_redirect_uri"],
94
+ "response_type": "code",
95
+ "scope": settings["idp_scopes"],
96
+ "state": state,
97
+ })
98
+ return cls(
99
+ url=url, state=state, code_verifier=verifier, code_challenge=challenge,
100
+ nonce=nonce, client_id=client_id, issuer_id=settings["idp_issuer_id"],
101
+ idp_redirect_uri=settings["idp_redirect_uri"],
102
+ )
103
+
104
+ @classmethod
105
+ def from_dict(cls, data: Dict[str, Any]) -> "LoginRequest":
106
+ return cls(**data)
107
+
108
+ def to_dict(self) -> Dict[str, Any]:
109
+ return asdict(self)
110
+
111
+ def extract_code(self, pasted: str) -> str:
112
+ """Code Decathlon depuis l'URL de la page d'erreur collée (ou le code seul)."""
113
+ pasted = (pasted or "").strip()
114
+ if not pasted:
115
+ raise GeocoverLoginError("Rien n'a été collé.")
116
+ if "code=" not in pasted:
117
+ if "/" in pasted or "?" in pasted or " " in pasted:
118
+ raise GeocoverLoginError("Aucun paramètre code= dans l'adresse collée.")
119
+ return pasted
120
+ query = urlparse(pasted).query or pasted.split("?", 1)[-1]
121
+ params = parse_qs(query)
122
+ code = params.get("code", [""])[0]
123
+ state = params.get("state", [None])[0]
124
+ if not code:
125
+ raise GeocoverLoginError("Paramètre code vide dans l'adresse collée.")
126
+ if state is not None and state != self.state:
127
+ raise GeocoverLoginError("Cette adresse ne correspond pas à la connexion en cours "
128
+ "(state différent) : relancez la connexion.")
129
+ return code
130
+
131
+ def idp_exchange_payload(self, idp_code: str) -> Dict[str, Any]:
132
+ """Étape 1 : corps JSON de POST /oauth (identique à la page login.ids)."""
133
+ return {
134
+ "client_id": self.client_id,
135
+ "issuer_id": self.issuer_id,
136
+ "code": idp_code,
137
+ "redirect_uri": APP_REDIRECT_URI,
138
+ "idp_redirect_uri": self.idp_redirect_uri,
139
+ "grant_type": "idp_authorization_code",
140
+ "code_challenge": self.code_challenge,
141
+ "code_challenge_method": "S256",
142
+ "nonce": self.nonce,
143
+ }
144
+
145
+ def token_payload(self, code: str, client_secret: str) -> Dict[str, str]:
146
+ """Étape 2 : formulaire de POST /oauth (ce que fait AppAuth dans l'app)."""
147
+ return {
148
+ "client_id": self.client_id,
149
+ "client_secret": client_secret,
150
+ "grant_type": "authorization_code",
151
+ "code": code,
152
+ "redirect_uri": APP_REDIRECT_URI,
153
+ "code_verifier": self.code_verifier,
154
+ }
pygeocover/cli.py ADDED
@@ -0,0 +1,180 @@
1
+ """Outil en ligne de commande : `python3 -m pygeocover <commande>`.
2
+
3
+ Commandes :
4
+ login connexion interactive (navigateur + coller l'adresse de la page d'erreur)
5
+ login-url étape 1 seule : affiche l'URL de connexion
6
+ login-finish URL étape 2 seule : termine la connexion avec l'URL collée
7
+ status vélos : position, batterie, état, santé, dernier trajet (défaut)
8
+ locations [HEURES] historique des positions (24 h par défaut)
9
+ rides [N] N derniers trajets (5 par défaut)
10
+
11
+ Fichier de configuration JSON (option --config, défaut ./geocover.json) :
12
+ créé au premier `login` ; les jetons y sont réécrits
13
+ à chaque rafraîchissement (refresh_token rotatif). Fichier PRIVÉ : ne jamais le partager.
14
+ """
15
+ from __future__ import annotations
16
+
17
+ import argparse
18
+ import asyncio
19
+ import json
20
+ import os
21
+ import sys
22
+ import warnings
23
+ import webbrowser
24
+ from datetime import datetime, timedelta, timezone
25
+ from pathlib import Path
26
+ from typing import Any, Dict
27
+
28
+ # Python système macOS (LibreSSL) : avertissement urllib3/aiohttp sans conséquence ici
29
+ warnings.filterwarnings("ignore", message="urllib3 v2 only supports OpenSSL")
30
+
31
+ import aiohttp # noqa: E402
32
+
33
+ from .auth import LoginRequest, TokenSet # noqa: E402
34
+ from .client import GeocoverClient # noqa: E402
35
+ from .const import DEFAULT_CLIENT_ID, DEFAULT_CLIENT_SECRET # noqa: E402
36
+ from .exceptions import GeocoverError # noqa: E402
37
+
38
+
39
+ class Config:
40
+ def __init__(self, path: Path) -> None:
41
+ self.path = path
42
+ # créé au premier `login` ; client_id/client_secret facultatifs (défauts de l'app)
43
+ self.data: Dict[str, Any] = (
44
+ json.loads(path.read_text(encoding="utf-8")) if path.exists() else {})
45
+
46
+ def save(self) -> None:
47
+ tmp = self.path.with_suffix(".tmp")
48
+ tmp.write_text(json.dumps(self.data, indent=2, ensure_ascii=False), encoding="utf-8")
49
+ os.chmod(tmp, 0o600)
50
+ tmp.replace(self.path) # écriture atomique : ne jamais perdre le refresh_token
51
+
52
+ def tokens(self) -> TokenSet | None:
53
+ return TokenSet.from_dict(self.data) if self.data.get("refresh_token") else None
54
+
55
+ def store_tokens(self, tokens: TokenSet) -> None:
56
+ self.data.update(tokens.to_dict())
57
+ self.save()
58
+
59
+
60
+ def _client(session: aiohttp.ClientSession, cfg: Config) -> GeocoverClient:
61
+ return GeocoverClient(
62
+ session, cfg.tokens(),
63
+ client_id=cfg.data.get("client_id", DEFAULT_CLIENT_ID),
64
+ client_secret=cfg.data.get("client_secret", DEFAULT_CLIENT_SECRET),
65
+ on_tokens_updated=cfg.store_tokens,
66
+ )
67
+
68
+
69
+ def _fmt(dt: datetime | None) -> str:
70
+ return dt.astimezone().strftime("%d/%m/%Y %H:%M") if dt else "—"
71
+
72
+
73
+ async def cmd_login(client: GeocoverClient, cfg: Config, interactive: bool, pasted: str = "") -> None:
74
+ if interactive or not pasted:
75
+ request = await client.async_start_login()
76
+ cfg.data["pending_login"] = request.to_dict()
77
+ cfg.save()
78
+ if not interactive:
79
+ print(request.url)
80
+ return
81
+ print("1) Connectez-vous à votre compte Decathlon dans le navigateur :\n\n "
82
+ + request.url + "\n")
83
+ webbrowser.open(request.url)
84
+ print("2) À la fin, une page « Whoops! Looks like something went wrong » s'affiche : c'est")
85
+ print(" normal. Copiez l'adresse complète de cette page (https://login.ids.conneq.tech/")
86
+ print(" redirect?code=…) et collez-la ici rapidement (le code expire vite).\n")
87
+ pasted = input("Adresse de la page d'erreur : ")
88
+ pending = cfg.data.get("pending_login")
89
+ if not pending:
90
+ sys.exit("Aucune connexion en cours : lancez d'abord `login-url`.")
91
+ await client.async_finish_login(LoginRequest.from_dict(pending), pasted)
92
+ cfg.data.pop("pending_login", None)
93
+ cfg.save()
94
+ print(f"[ok] connecté — jetons enregistrés dans {cfg.path}")
95
+
96
+
97
+ async def cmd_status(client: GeocoverClient) -> None:
98
+ user = await client.async_get_user()
99
+ print(f"Compte : {user.name} ({user.country})")
100
+ for bike in await client.async_get_bikes():
101
+ loc = bike.last_location
102
+ state = await client.async_get_state(bike.id)
103
+ health = await client.async_get_health(bike.id)
104
+ battery = await client.async_get_battery(bike.id)
105
+ ride = await client.async_get_latest_ride(bike.id)
106
+ print(f"\n=== {bike.name} (id {bike.id}) ===")
107
+ print(f" batterie : {bike.battery_percentage} % (autonomie {battery.range_km} km,"
108
+ f" en charge : {battery.charging})")
109
+ if loc:
110
+ print(f" position : {loc.lat}, {loc.lon} le {_fmt(loc.date)}")
111
+ print(f" en mouvement : {loc.is_moving} (vitesse {loc.speed})")
112
+ print(f" odomètre : {bike.odometer_km} km")
113
+ if state:
114
+ print(f" allumé : {state.powered_on} | verrouillé : {state.ecu_locked}")
115
+ print(f" dernière connexion : {_fmt(health.last_connection)} | dernier GPS : "
116
+ f"{_fmt(health.last_gps)} | batterie traceur : {health.gps_battery} %")
117
+ for g in bike.geofences:
118
+ print(f" géofence : {g.name} ({g.lat}, {g.lon}, r={g.radius} m, active={g.active})")
119
+ if ride:
120
+ print(f" dernier trajet : {_fmt(ride.start_date)} → {_fmt(ride.end_date)}, "
121
+ f"{ride.distance_km} km, {ride.avg_speed} km/h, +{ride.elevation_up} m")
122
+
123
+
124
+ async def cmd_locations(client: GeocoverClient, hours: int) -> None:
125
+ end = datetime.now(timezone.utc)
126
+ for bike in await client.async_get_bikes():
127
+ points = await client.async_get_locations(bike.id, end - timedelta(hours=hours), end)
128
+ print(f"=== {bike.name} : {len(points)} positions sur {hours} h ===")
129
+ for p in points:
130
+ print(f" {_fmt(p.date)} {p.lat:.6f}, {p.lon:.6f} v={p.speed} mouvement={p.is_moving}")
131
+
132
+
133
+ async def cmd_rides(client: GeocoverClient, count: int) -> None:
134
+ for bike in await client.async_get_bikes():
135
+ page = await client.async_get_rides(bike.id, limit=count)
136
+ print(f"=== {bike.name} : {page.total} trajets au total, {len(page.rides)} derniers ===")
137
+ for r in page.rides:
138
+ minutes = round((r.active_time_s or 0) / 60)
139
+ print(f" {_fmt(r.start_date)} {r.distance_km:>6} km {minutes:>3} min "
140
+ f"{r.avg_speed} km/h +{r.elevation_up}/-{r.elevation_down} m")
141
+
142
+
143
+ async def run(args: argparse.Namespace) -> None:
144
+ cfg = Config(Path(args.config))
145
+ async with aiohttp.ClientSession() as session:
146
+ client = _client(session, cfg)
147
+ if args.command == "login":
148
+ await cmd_login(client, cfg, interactive=True)
149
+ elif args.command == "login-url":
150
+ await cmd_login(client, cfg, interactive=False)
151
+ elif args.command == "login-finish":
152
+ if not args.arg:
153
+ sys.exit("Usage : login-finish '<adresse de la page d'erreur>'")
154
+ await cmd_login(client, cfg, interactive=False, pasted=args.arg)
155
+ elif cfg.tokens() is None:
156
+ sys.exit("Pas encore connecté : lancez `python3 -m pygeocover login`.")
157
+ elif args.command == "locations":
158
+ await cmd_locations(client, int(args.arg or 24))
159
+ elif args.command == "rides":
160
+ await cmd_rides(client, int(args.arg or 5))
161
+ else:
162
+ await cmd_status(client)
163
+
164
+
165
+ def main() -> None:
166
+ parser = argparse.ArgumentParser(prog="pygeocover", description=__doc__,
167
+ formatter_class=argparse.RawDescriptionHelpFormatter)
168
+ parser.add_argument("command", nargs="?", default="status",
169
+ choices=["login", "login-url", "login-finish", "status", "locations", "rides"])
170
+ parser.add_argument("arg", nargs="?")
171
+ parser.add_argument("--config", default=os.environ.get("PYGEOCOVER_CONFIG", "geocover.json"))
172
+ args = parser.parse_args()
173
+ try:
174
+ asyncio.run(run(args))
175
+ except GeocoverError as err:
176
+ sys.exit(f"Erreur : {err}")
177
+
178
+
179
+ if __name__ == "__main__":
180
+ main()
pygeocover/client.py ADDED
@@ -0,0 +1,227 @@
1
+ """Client asynchrone de l'API vélo Geocover."""
2
+ from __future__ import annotations
3
+
4
+ import asyncio
5
+ import inspect
6
+ import logging
7
+ from datetime import datetime
8
+ from typing import Any, Awaitable, Callable, Dict, List, Optional, Union
9
+
10
+ import aiohttp
11
+
12
+ from .auth import LoginRequest, TokenSet
13
+ from .const import (
14
+ DEFAULT_BRAND, DEFAULT_CLIENT_ID, DEFAULT_CLIENT_SECRET, IDS_API, REQUEST_TIMEOUT, TOKEN_URL, bike_api_url,
15
+ )
16
+ from .exceptions import (
17
+ GeocoverApiError,
18
+ GeocoverAuthError,
19
+ GeocoverConnectionError,
20
+ GeocoverLoginError,
21
+ )
22
+ from .models import (
23
+ BatteryState,
24
+ Bike,
25
+ BikeState,
26
+ Geofence,
27
+ Health,
28
+ Location,
29
+ Ride,
30
+ RidePage,
31
+ User,
32
+ format_datetime,
33
+ )
34
+
35
+ _LOGGER = logging.getLogger(__name__)
36
+
37
+ TokenCallback = Callable[[TokenSet], Union[None, Awaitable[None]]]
38
+
39
+
40
+ class GeocoverClient:
41
+ """Accès à l'API vélo pour un compte.
42
+
43
+ Le refresh_token est ROTATIF et à usage unique : chaque rafraîchissement en
44
+ renvoie un nouveau et invalide l'ancien. `on_tokens_updated` est appelé à chaque
45
+ nouveau jeu de jetons ; l'appelant DOIT le persister (sinon déconnexion au
46
+ prochain redémarrage).
47
+ """
48
+
49
+ def __init__(
50
+ self,
51
+ session: aiohttp.ClientSession,
52
+ tokens: Optional[TokenSet] = None,
53
+ *,
54
+ client_id: str = DEFAULT_CLIENT_ID,
55
+ client_secret: str = DEFAULT_CLIENT_SECRET,
56
+ brand: str = DEFAULT_BRAND,
57
+ on_tokens_updated: Optional[TokenCallback] = None,
58
+ ) -> None:
59
+ self._session = session
60
+ self._client_id = client_id
61
+ self._client_secret = client_secret
62
+ self._base_url = bike_api_url(brand)
63
+ self._on_tokens_updated = on_tokens_updated
64
+ self._refresh_lock = asyncio.Lock()
65
+ self.tokens = tokens
66
+
67
+ # --- connexion -----------------------------------------------------------
68
+
69
+ async def async_start_login(self) -> LoginRequest:
70
+ """Prépare une connexion : ouvrir `request.url` dans un navigateur."""
71
+ settings = await self._raw_request(
72
+ "GET", f"{IDS_API}/client/{self._client_id}/setting/loginpage")
73
+ return LoginRequest.create(settings, self._client_id)
74
+
75
+ async def async_finish_login(self, request: LoginRequest, pasted: str) -> TokenSet:
76
+ """Termine la connexion avec l'URL de la page d'erreur collée par l'utilisateur."""
77
+ idp_code = request.extract_code(pasted)
78
+ try:
79
+ data = await self._raw_request(
80
+ "POST", TOKEN_URL, json=request.idp_exchange_payload(idp_code))
81
+ except GeocoverApiError as err:
82
+ raise GeocoverLoginError(
83
+ f"Code Decathlon refusé ({err}) : il a peut-être expiré, relancez la connexion."
84
+ ) from err
85
+ code = data.get("code") if isinstance(data, dict) else None
86
+ if not code:
87
+ raise GeocoverLoginError(f"Réponse inattendue à l'échange du code : {data!r}")
88
+ try:
89
+ data = await self._raw_request(
90
+ "POST", TOKEN_URL, data=request.token_payload(code, self._client_secret))
91
+ except GeocoverApiError as err:
92
+ raise GeocoverLoginError(f"Obtention des jetons refusée ({err}).") from err
93
+ await self._set_tokens(TokenSet.from_response(data))
94
+ return self.tokens # type: ignore[return-value]
95
+
96
+ # --- jetons --------------------------------------------------------------
97
+
98
+ async def async_refresh_tokens(self, force: bool = False) -> TokenSet:
99
+ """Rafraîchit l'access_token si nécessaire (ou toujours si `force`)."""
100
+ if self.tokens is None:
101
+ raise GeocoverAuthError("Aucun jeton : connexion nécessaire.")
102
+ stale = self.tokens.access_token
103
+ async with self._refresh_lock:
104
+ # un autre appel a pu rafraîchir pendant l'attente du verrou
105
+ if force and self.tokens.access_token != stale:
106
+ return self.tokens
107
+ if not force and not self.tokens.needs_refresh():
108
+ return self.tokens
109
+ try:
110
+ data = await self._raw_request("POST", TOKEN_URL, data={
111
+ "client_id": self._client_id,
112
+ "client_secret": self._client_secret,
113
+ "refresh_token": self.tokens.refresh_token,
114
+ "grant_type": "refresh_token",
115
+ })
116
+ except GeocoverApiError as err:
117
+ if err.status in (400, 401, 403):
118
+ raise GeocoverAuthError(
119
+ f"refresh_token refusé ({err}) : nouvelle connexion nécessaire."
120
+ ) from err
121
+ raise
122
+ await self._set_tokens(TokenSet.from_response(data))
123
+ _LOGGER.debug("Jetons rafraîchis")
124
+ return self.tokens # type: ignore[return-value]
125
+
126
+ async def _set_tokens(self, tokens: TokenSet) -> None:
127
+ self.tokens = tokens
128
+ if self._on_tokens_updated is not None:
129
+ result = self._on_tokens_updated(tokens)
130
+ if inspect.isawaitable(result):
131
+ await result
132
+
133
+ # --- HTTP ----------------------------------------------------------------
134
+
135
+ async def _raw_request(self, method: str, url: str, **kwargs: Any) -> Any:
136
+ headers = {"Accept": "application/json", **kwargs.pop("headers", {})}
137
+ try:
138
+ async with self._session.request(
139
+ method, url, headers=headers,
140
+ timeout=aiohttp.ClientTimeout(total=REQUEST_TIMEOUT), **kwargs,
141
+ ) as resp:
142
+ if resp.status >= 400:
143
+ raise GeocoverApiError(resp.status, await _error_detail(resp))
144
+ if resp.status == 204:
145
+ return None
146
+ return await resp.json(content_type=None)
147
+ except (aiohttp.ClientError, asyncio.TimeoutError) as err:
148
+ raise GeocoverConnectionError(f"{method} {url} : {err!r}") from err
149
+
150
+ async def _api(self, path: str, params: Optional[Dict[str, Any]] = None) -> Any:
151
+ """GET authentifié sur l'API vélo ; 401 -> refresh forcé -> un seul nouvel essai."""
152
+ await self.async_refresh_tokens()
153
+ for attempt in (1, 2):
154
+ assert self.tokens is not None
155
+ try:
156
+ return await self._raw_request(
157
+ "GET", self._base_url + path, params=params,
158
+ headers={"Authorization": f"Bearer {self.tokens.access_token}",
159
+ "Accept-Language": "fr"})
160
+ except GeocoverApiError as err:
161
+ if err.status != 401:
162
+ raise
163
+ if attempt == 2:
164
+ raise GeocoverAuthError(f"Accès refusé à {path} malgré un jeton neuf.") from err
165
+ await self.async_refresh_tokens(force=True)
166
+
167
+ # --- endpoints -----------------------------------------------------------
168
+
169
+ async def async_get_user(self) -> User:
170
+ return User.from_dict(await self._api("user/me"))
171
+
172
+ async def async_get_bikes(self) -> List[Bike]:
173
+ """Un seul appel : position, batterie, odomètre et géofences de chaque vélo."""
174
+ return [Bike.from_dict(b) for b in await self._api("bike") or []]
175
+
176
+ async def async_get_bike(self, bike_id: int) -> Bike:
177
+ return Bike.from_dict(await self._api(f"bike/{bike_id}"))
178
+
179
+ async def async_get_locations(
180
+ self, bike_id: int, start: datetime, end: datetime
181
+ ) -> List[Location]:
182
+ """Historique des positions (du plus récent au plus ancien). Dates avec fuseau."""
183
+ data = await self._api(f"bike/{bike_id}/location",
184
+ {"from": format_datetime(start), "till": format_datetime(end)})
185
+ return [Location.from_dict(item) for item in data or []]
186
+
187
+ async def async_get_battery(self, bike_id: int) -> BatteryState:
188
+ return BatteryState.from_dict(await self._api(f"bike/{bike_id}/battery/current-state"))
189
+
190
+ async def async_get_state(self, bike_id: int) -> Optional[BikeState]:
191
+ data = await self._api(f"bike/{bike_id}/state")
192
+ return BikeState.from_dict(data[0]) if data else None
193
+
194
+ async def async_get_health(self, bike_id: int) -> Health:
195
+ return Health.from_list(await self._api(f"bike/{bike_id}/health") or [])
196
+
197
+ async def async_get_geofences(self, bike_id: int) -> List[Geofence]:
198
+ return [Geofence.from_dict(g) for g in await self._api(f"bike/{bike_id}/geofence") or []]
199
+
200
+ async def async_get_rides(
201
+ self, bike_id: int, limit: int = 20, offset: int = 0, newest_first: bool = True
202
+ ) -> RidePage:
203
+ """Trajets paginés ; tri `order=<champ>;<sens>` comme l'app (défaut serveur : ascendant)."""
204
+ order = "start_date;desc" if newest_first else "start_date;asc"
205
+ data = await self._api(f"v2/bike/{bike_id}/ride",
206
+ {"limit": limit, "offset": offset, "order": order})
207
+ meta = data.get("meta") or {}
208
+ return RidePage(
209
+ rides=[Ride.from_dict(r) for r in data.get("data") or []],
210
+ total=int(meta.get("total_records") or 0),
211
+ offset=int(meta.get("offset") or offset),
212
+ limit=int(meta.get("limit") or limit),
213
+ )
214
+
215
+ async def async_get_latest_ride(self, bike_id: int) -> Optional[Ride]:
216
+ page = await self.async_get_rides(bike_id, limit=1)
217
+ return page.rides[0] if page.rides else None
218
+
219
+
220
+ async def _error_detail(resp: aiohttp.ClientResponse) -> str:
221
+ try:
222
+ body = await resp.json(content_type=None)
223
+ except Exception: # noqa: BLE001 - corps non JSON
224
+ return (await resp.text())[:200]
225
+ if isinstance(body, dict):
226
+ return str(body.get("detail") or body.get("error_description") or body.get("error") or body)
227
+ return str(body)[:200]
pygeocover/const.py ADDED
@@ -0,0 +1,25 @@
1
+ """Constantes de l'API Geocover (Conneqtech, marque blanche Decathlon)."""
2
+ from __future__ import annotations
3
+
4
+ DEFAULT_BRAND = "decathlon"
5
+
6
+ # Client OAuth de l'app Android com.conneqtech.decathlon, identique pour tous ses utilisateurs.
7
+ # Secret embarqué dans une app publique : non confidentiel au sens de la RFC 8252 §8.5.
8
+ DEFAULT_CLIENT_ID = "5c0d36ce-7396-46f0-bcc0-3c6e16c0d2b6"
9
+ DEFAULT_CLIENT_SECRET = "_NU4.j2A!f!YawfpDFKdWBDQemuMtrYa"
10
+ APP_REDIRECT_URI = "tech.conneq.decathlon://decathlon.app.ids.conneq.tech"
11
+
12
+ IDS_API = "https://api.ids.conneq.tech"
13
+ TOKEN_URL = IDS_API + "/oauth"
14
+
15
+ # redirectURI placée dans le `state` de login : volontairement non autorisée pour que
16
+ # la page login.ids.conneq.tech échoue sans consommer le code Decathlon (voir auth.py).
17
+ UNROUTABLE_REDIRECT_URI = "https://localhost/pygeocover"
18
+
19
+ # marge avant expiration à partir de laquelle on rafraîchit l'access_token (s)
20
+ TOKEN_REFRESH_MARGIN = 300
21
+ REQUEST_TIMEOUT = 30
22
+
23
+
24
+ def bike_api_url(brand: str = DEFAULT_BRAND) -> str:
25
+ return f"https://{brand}.api.bike.conneq.tech/"
@@ -0,0 +1,27 @@
1
+ """Exceptions de pygeocover."""
2
+ from __future__ import annotations
3
+
4
+
5
+ class GeocoverError(Exception):
6
+ """Erreur de base."""
7
+
8
+
9
+ class GeocoverConnectionError(GeocoverError):
10
+ """Serveur injoignable ou délai dépassé (erreur transitoire)."""
11
+
12
+
13
+ class GeocoverAuthError(GeocoverError):
14
+ """Jetons invalides ou expirés : une nouvelle connexion est nécessaire."""
15
+
16
+
17
+ class GeocoverLoginError(GeocoverError):
18
+ """Échec de la connexion (code expiré, URL collée invalide…)."""
19
+
20
+
21
+ class GeocoverApiError(GeocoverError):
22
+ """Réponse d'erreur de l'API (hors authentification)."""
23
+
24
+ def __init__(self, status: int, detail: str = "") -> None:
25
+ super().__init__(f"HTTP {status}: {detail}" if detail else f"HTTP {status}")
26
+ self.status = status
27
+ self.detail = detail
pygeocover/models.py ADDED
@@ -0,0 +1,270 @@
1
+ """Modèles de données de l'API vélo (réponses réelles observées le 2026-09-28)."""
2
+ from __future__ import annotations
3
+
4
+ from dataclasses import dataclass, field
5
+ from datetime import datetime
6
+ from typing import Any, Dict, List, Optional
7
+
8
+
9
+ def parse_datetime(value: Any) -> Optional[datetime]:
10
+ """Dates API au format `2026-09-28T06:25:36+0000` (ou `+00:00` / `Z`)."""
11
+ if not value or not isinstance(value, str):
12
+ return None
13
+ text = value.strip()
14
+ if text.endswith("Z"):
15
+ text = text[:-1] + "+0000"
16
+ for fmt in ("%Y-%m-%dT%H:%M:%S%z", "%Y-%m-%dT%H:%M:%S.%f%z"):
17
+ try:
18
+ dt = datetime.strptime(text, fmt)
19
+ except ValueError:
20
+ continue
21
+ # l'API renvoie 1970-01-01 pour « non renseigné »
22
+ return None if dt.year <= 1970 else dt
23
+ return None
24
+
25
+
26
+ def format_datetime(value: datetime) -> str:
27
+ """Format attendu par les paramètres `from`/`till` (ISO 8601 ; epoch -> HTTP 422)."""
28
+ return value.strftime("%Y-%m-%dT%H:%M:%S%z")
29
+
30
+
31
+ def _float(value: Any) -> Optional[float]:
32
+ try:
33
+ return float(value) if value is not None else None
34
+ except (TypeError, ValueError):
35
+ return None
36
+
37
+
38
+ def _int(value: Any) -> Optional[int]:
39
+ try:
40
+ return int(value) if value is not None else None
41
+ except (TypeError, ValueError):
42
+ return None
43
+
44
+
45
+ @dataclass
46
+ class Location:
47
+ lat: Optional[float]
48
+ lon: Optional[float]
49
+ date: Optional[datetime]
50
+ speed: Optional[float]
51
+ is_moving: bool
52
+ # 0 dans l'historique ; seule `Bike.last_location` porte la vraie valeur
53
+ battery_percentage: Optional[int]
54
+ bike_id: Optional[int]
55
+ id: Optional[str]
56
+
57
+ @classmethod
58
+ def from_dict(cls, data: Dict[str, Any]) -> "Location":
59
+ return cls(
60
+ lat=_float(data.get("lat")),
61
+ lon=_float(data.get("lon")),
62
+ date=parse_datetime(data.get("date")),
63
+ speed=_float(data.get("speed")),
64
+ is_moving=bool(data.get("is_moving")),
65
+ battery_percentage=_int(data.get("battery_percentage")),
66
+ bike_id=_int(data.get("bike_id")),
67
+ id=data.get("id"),
68
+ )
69
+
70
+
71
+ @dataclass
72
+ class Geofence:
73
+ id: int
74
+ name: str
75
+ lat: Optional[float]
76
+ lon: Optional[float]
77
+ radius: Optional[float] # mètres
78
+ active: bool
79
+
80
+ @classmethod
81
+ def from_dict(cls, data: Dict[str, Any]) -> "Geofence":
82
+ center = data.get("center") or {}
83
+ return cls(
84
+ id=int(data["id"]),
85
+ name=data.get("name") or "",
86
+ lat=_float(center.get("lat")),
87
+ lon=_float(center.get("lon")),
88
+ radius=_float(data.get("radius")),
89
+ active=data.get("active_state") == 0, # 0 = active (convention Conneqtech)
90
+ )
91
+
92
+
93
+ @dataclass
94
+ class Bike:
95
+ id: int
96
+ name: str
97
+ imei: Optional[str]
98
+ battery_percentage: Optional[int]
99
+ odometer_m: Optional[int]
100
+ last_location: Optional[Location]
101
+ geofences: List[Geofence]
102
+ manufacturer: Optional[str]
103
+ frame_number: Optional[str]
104
+ article_number: Optional[str]
105
+ image_url: Optional[str]
106
+ is_stolen: bool
107
+ ride_in_progress: bool
108
+ raw: Dict[str, Any] = field(repr=False)
109
+
110
+ @property
111
+ def odometer_km(self) -> Optional[float]:
112
+ return None if self.odometer_m is None else round(self.odometer_m / 1000, 1)
113
+
114
+ @classmethod
115
+ def from_dict(cls, data: Dict[str, Any]) -> "Bike":
116
+ loc = data.get("last_location")
117
+ return cls(
118
+ id=int(data["id"]),
119
+ name=data.get("name") or f"Vélo {data['id']}",
120
+ imei=data.get("imei"),
121
+ battery_percentage=_int(data.get("battery_percentage")),
122
+ odometer_m=_int(data.get("odometer")),
123
+ last_location=Location.from_dict(loc) if loc else None,
124
+ geofences=[Geofence.from_dict(g) for g in data.get("geofences") or []],
125
+ manufacturer=data.get("manufacturer"),
126
+ frame_number=data.get("frame_number"),
127
+ article_number=data.get("article_number"),
128
+ image_url=data.get("bike_image_url"),
129
+ is_stolen=bool(data.get("is_stolen")),
130
+ ride_in_progress=bool(data.get("ride_in_progress")),
131
+ raw=data,
132
+ )
133
+
134
+
135
+ @dataclass
136
+ class BatteryState:
137
+ battery_percentage: Optional[int]
138
+ charging: Optional[bool]
139
+ range_km: Optional[float]
140
+ last_battery_update: Optional[datetime]
141
+ last_full_charge: Optional[datetime]
142
+
143
+ @classmethod
144
+ def from_dict(cls, data: Dict[str, Any]) -> "BatteryState":
145
+ return cls(
146
+ battery_percentage=_int(data.get("battery_percentage")),
147
+ charging=data.get("charging"),
148
+ range_km=_float(data.get("range")),
149
+ last_battery_update=parse_datetime(data.get("last_battery_update")),
150
+ last_full_charge=parse_datetime(data.get("last_full_charge")),
151
+ )
152
+
153
+
154
+ @dataclass
155
+ class BikeState:
156
+ powered_on: Optional[bool]
157
+ ecu_locked: Optional[bool]
158
+ erl_locked: Optional[bool]
159
+ battery_percentage: Optional[int]
160
+ charging: Optional[bool]
161
+ range_km: Optional[float]
162
+ odometer_km: Optional[float] # en km ici (Bike.odometer_m est en mètres)
163
+ last_full_charge: Optional[datetime]
164
+
165
+ @classmethod
166
+ def from_dict(cls, data: Dict[str, Any]) -> "BikeState":
167
+ return cls(
168
+ powered_on=data.get("powered_on"),
169
+ ecu_locked=data.get("ecu_locked"),
170
+ erl_locked=data.get("erl_locked"),
171
+ battery_percentage=_int(data.get("battery_percentage")),
172
+ charging=data.get("charging"),
173
+ range_km=_float(data.get("range")),
174
+ odometer_km=_float(data.get("odometer")),
175
+ last_full_charge=parse_datetime(data.get("last_full_charge")),
176
+ )
177
+
178
+
179
+ @dataclass
180
+ class Health:
181
+ """`GET bike/{id}/health` : liste {key, status, value, value_type} aplatie."""
182
+
183
+ last_connection: Optional[datetime]
184
+ last_gps: Optional[datetime]
185
+ gps_battery: Optional[int] # % de la batterie du traceur GPS
186
+ bike_system: Optional[bool]
187
+ statuses: Dict[str, bool]
188
+ raw: List[Dict[str, Any]] = field(repr=False)
189
+
190
+ @classmethod
191
+ def from_list(cls, items: List[Dict[str, Any]]) -> "Health":
192
+ values = {i.get("key"): i.get("value") for i in items}
193
+ gps_battery = values.get("gps_battery")
194
+ system = values.get("bike_system")
195
+ return cls(
196
+ last_connection=parse_datetime(values.get("last_connection")),
197
+ last_gps=parse_datetime(values.get("last_gps")),
198
+ gps_battery=_int(str(gps_battery).rstrip("%")) if gps_battery is not None else None,
199
+ bike_system=None if system is None else str(system).lower() == "true",
200
+ statuses={i.get("key"): bool(i.get("status")) for i in items},
201
+ raw=items,
202
+ )
203
+
204
+
205
+ @dataclass
206
+ class Ride:
207
+ id: int
208
+ start_date: Optional[datetime]
209
+ end_date: Optional[datetime]
210
+ distance_m: Optional[int]
211
+ active_time_s: Optional[int]
212
+ avg_speed: Optional[float] # km/h
213
+ calories: Optional[int]
214
+ co2: Optional[int] # unité non documentée (g économisés ?)
215
+ elevation_up: Optional[int]
216
+ elevation_down: Optional[int]
217
+ rating: Optional[int]
218
+ ride_type: Optional[str]
219
+ weather_type: Optional[str]
220
+ name: str
221
+
222
+ @property
223
+ def distance_km(self) -> Optional[float]:
224
+ return None if self.distance_m is None else round(self.distance_m / 1000, 2)
225
+
226
+ @classmethod
227
+ def from_dict(cls, data: Dict[str, Any]) -> "Ride":
228
+ return cls(
229
+ id=int(data["id"]),
230
+ start_date=parse_datetime(data.get("start_date")),
231
+ end_date=parse_datetime(data.get("end_date")),
232
+ distance_m=_int(data.get("distance_traveled")),
233
+ active_time_s=_int(data.get("active_time")),
234
+ avg_speed=_float(data.get("avg_speed")),
235
+ calories=_int(data.get("calories")),
236
+ co2=_int(data.get("co2")),
237
+ elevation_up=_int(data.get("elevation_up")),
238
+ elevation_down=_int(data.get("elevation_down")),
239
+ rating=_int(data.get("rating")),
240
+ ride_type=data.get("ride_type"),
241
+ weather_type=(data.get("weather_info") or {}).get("weather_type"),
242
+ name=data.get("name") or "",
243
+ )
244
+
245
+
246
+ @dataclass
247
+ class RidePage:
248
+ rides: List[Ride]
249
+ total: int
250
+ offset: int
251
+ limit: int
252
+
253
+
254
+ @dataclass
255
+ class User:
256
+ id: int
257
+ username: str # UUID Conneqtech, identifiant stable
258
+ name: Optional[str]
259
+ email: Optional[str]
260
+ country: Optional[str]
261
+
262
+ @classmethod
263
+ def from_dict(cls, data: Dict[str, Any]) -> "User":
264
+ return cls(
265
+ id=int(data["id"]),
266
+ username=data.get("username") or str(data["id"]),
267
+ name=data.get("display_name") or data.get("name"),
268
+ email=data.get("email"),
269
+ country=data.get("country"),
270
+ )
pygeocover/py.typed ADDED
File without changes
@@ -0,0 +1,89 @@
1
+ Metadata-Version: 2.4
2
+ Name: pygeocover
3
+ Version: 0.1.0
4
+ Summary: Client asynchrone non officiel pour l'API Decathlon Geocover (Conneqtech)
5
+ Author: 3615nulsi
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/3615nulsi/pygeocover
8
+ Project-URL: Issues, https://github.com/3615nulsi/pygeocover/issues
9
+ Classifier: Framework :: AsyncIO
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: aiohttp>=3.9
15
+ Provides-Extra: test
16
+ Requires-Dist: pytest>=8; extra == "test"
17
+ Requires-Dist: pytest-asyncio>=0.23; extra == "test"
18
+ Dynamic: license-file
19
+
20
+ # pygeocover
21
+
22
+ Client Python **asynchrone** (aiohttp) non officiel pour l'API grand public
23
+ **Decathlon Geocover** (plateforme Conneqtech), destiné à l'intégration Home Assistant.
24
+
25
+ ## Installation locale
26
+ ```bash
27
+ python3 -m pip install --user -e ".[test]"
28
+ ```
29
+
30
+ ## Ligne de commande
31
+ Configuration : `geocover.json` dans le dossier courant (ou `--config`, ou `$PYGEOCOVER_CONFIG`),
32
+ créé au premier `login` et contenant vos jetons. **Fichier privé**, ignoré par git.
33
+
34
+ ```bash
35
+ python3 -m pygeocover login # connexion (voir ci-dessous)
36
+ python3 -m pygeocover # état : position, batterie, santé, dernier trajet
37
+ python3 -m pygeocover rides 10 # 10 derniers trajets
38
+ python3 -m pygeocover locations 24 # positions des dernières 24 h
39
+ ```
40
+
41
+ ### Connexion
42
+ Le navigateur s'ouvre sur la connexion Decathlon. À la fin, une page Conneqtech
43
+ « Whoops! Looks like something went wrong » s'affiche : **c'est voulu**. Copiez son adresse
44
+ (`https://login.ids.conneq.tech/redirect?code=…`) et collez-la dans le terminal rapidement.
45
+ Explication technique dans `auth.py`.
46
+
47
+ ## Utilisation en Python
48
+ ```python
49
+ import aiohttp
50
+ from pygeocover import GeocoverClient, TokenSet
51
+
52
+ async with aiohttp.ClientSession() as session:
53
+ client = GeocoverClient(session,
54
+ TokenSet.from_dict(saved), # ou None avant connexion
55
+ on_tokens_updated=persist) # OBLIGATOIRE : refresh_token rotatif
56
+ # connexion : req = await client.async_start_login(); ouvrir req.url ;
57
+ # await client.async_finish_login(req, url_collee)
58
+ bikes = await client.async_get_bikes() # position + batterie + odomètre + géofences
59
+ ```
60
+
61
+ | Méthode | Endpoint |
62
+ |---|---|
63
+ | `async_get_user()` | `GET user/me` |
64
+ | `async_get_bikes()` / `async_get_bike(id)` | `GET bike`, `GET bike/{id}` |
65
+ | `async_get_locations(id, start, end)` | `GET bike/{id}/location?from=&till=` (ISO 8601) |
66
+ | `async_get_battery(id)` | `GET bike/{id}/battery/current-state` |
67
+ | `async_get_state(id)` | `GET bike/{id}/state` |
68
+ | `async_get_health(id)` | `GET bike/{id}/health` |
69
+ | `async_get_geofences(id)` | `GET bike/{id}/geofence` |
70
+ | `async_get_rides(id, limit, offset)` / `async_get_latest_ride(id)` | `GET v2/bike/{id}/ride` |
71
+
72
+ Exceptions : `GeocoverAuthError` (reconnexion nécessaire), `GeocoverConnectionError`
73
+ (transitoire), `GeocoverApiError`, `GeocoverLoginError`.
74
+
75
+ ## Points d'attention
76
+ - **refresh_token rotatif à usage unique** : chaque rafraîchissement l'invalide ; le client appelle
77
+ `on_tokens_updated` à chaque nouveau jeton, l'appelant doit le persister immédiatement.
78
+ Un même refresh_token ne doit être utilisé que par **un seul** programme à la fois.
79
+ - `Accept: application/json` obligatoire (sinon HTTP 406) — géré par le client.
80
+ - Trajets : tri par `order=start_date;desc` (syntaxe `champ;sens` trouvée dans l'APK,
81
+ service `n1`) ; sans ce paramètre le serveur renvoie du plus ancien au plus récent.
82
+ Filtres (non utilisés) au format `filter[]=or;bike_id;eq;<id>`.
83
+ - `client_id` / `client_secret` : ceux de l'app Android, identiques pour tous ses utilisateurs, inclus
84
+ par défaut (secret « non confidentiel » au sens de la RFC 8252 §8.5). Surchargeables.
85
+
86
+ ## Tests
87
+ ```bash
88
+ PYTHONPATH=src python3 -m pytest -q
89
+ ```
@@ -0,0 +1,15 @@
1
+ pygeocover/__init__.py,sha256=DEuczFYuAAwQVGS44gNEArwRUfn26w1azZSXmXN6ED8,773
2
+ pygeocover/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
3
+ pygeocover/auth.py,sha256=tlX0WyP_w8NnAiIvihdHROjQIreYr32Oa-GNbrHu3F0,6038
4
+ pygeocover/cli.py,sha256=tmraVssGGe_A9HT9k88NWbja1nA0Vw7Nd58-XmxM_yQ,8101
5
+ pygeocover/client.py,sha256=uHW-GCwZoFInWo_4LnM-GG0z-_nQZR46MCDSTUbF7k0,9756
6
+ pygeocover/const.py,sha256=JPOd4Ik6CVLw0ibqwuEKDQ3E4ZQT2oGrOcpGuEqYjqU,1063
7
+ pygeocover/exceptions.py,sha256=4ImglNyfeA_Bt4Bd4FwNAE0kFteN_fk3rhyy1U00XgU,797
8
+ pygeocover/models.py,sha256=YoDoq9KW_g8L6cDPgpfvrS3b4jHBBEjATQ8_VyOjTjc,8848
9
+ pygeocover/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ pygeocover-0.1.0.dist-info/licenses/LICENSE,sha256=rSHwA2KsC_qdSe6nTwqbR37IWxAisEn_VLnHXcQWCoA,1066
11
+ pygeocover-0.1.0.dist-info/METADATA,sha256=N1nXDTLuxe0-_x00YiwhqB6HKCxs9dRuvyYnyMAj7oQ,3931
12
+ pygeocover-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
13
+ pygeocover-0.1.0.dist-info/entry_points.txt,sha256=FGOoS97WOHsVc17FmLnE4lEtK71YvNtZAM2YMdG5RKA,51
14
+ pygeocover-0.1.0.dist-info/top_level.txt,sha256=Rk7L4Fz7OdSw9xaOOsP1PvY1xIZidXbvr8pdn0kEhlM,11
15
+ pygeocover-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pygeocover = pygeocover.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 3615nulsi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ pygeocover