didupwrapper 0.1.0__tar.gz

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.
@@ -0,0 +1,181 @@
1
+ Metadata-Version: 2.4
2
+ Name: didupwrapper
3
+ Version: 0.1.0
4
+ Summary: Wrapper Python (sync + async) per le API non documentate del registro elettronico DiDUP / Argo Famiglia
5
+ Project-URL: Homepage, https://github.com/Rocciadura/DiDup-API-Wrapper
6
+ Project-URL: Issues, https://github.com/Rocciadura/DiDup-API-Wrapper/issues
7
+ Author: didupwrapper contributors
8
+ License: MIT
9
+ Keywords: api,argo,didup,registro elettronico,scuola,wrapper
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: httpx>=0.27
19
+ Requires-Dist: pydantic>=2.6
20
+ Provides-Extra: dev
21
+ Requires-Dist: mypy>=1.8; extra == 'dev'
22
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
23
+ Requires-Dist: pytest>=8.0; extra == 'dev'
24
+ Requires-Dist: respx>=0.21; extra == 'dev'
25
+ Requires-Dist: ruff>=0.4; extra == 'dev'
26
+ Description-Content-Type: text/markdown
27
+
28
+ <<<<<<< HEAD
29
+ # DiDup-API-Wrapper
30
+ Didup API Wrapper | ARGO SOFTWARE
31
+ =======
32
+ # didupwrapper
33
+
34
+ Wrapper Python **open-source** (sync + async) per le API **non documentate** del
35
+ registro elettronico **DiDUP / Argo Famiglia**
36
+
37
+ > Le API non sono pubbliche né documentate da Argo. Questa libreria è basata
38
+ > su reverse-engineering del traffico dell'app. Usala in modo responsabile e
39
+ > solo con le tue credenziali.
40
+ >
41
+ > Il login usa il vero flusso **OAuth2/PKCE** dell'app DidUP Famiglia. L'header
42
+ > `argo-client-version` deve combaciare con l'ultima versione dell'app sugli
43
+ > store (attualmente **1.29.2**): se diventa obsoleto il server risponde `410`.
44
+
45
+ ### Versione client (`argo-client-version`)
46
+
47
+ Tre modi, in ordine di priorità:
48
+
49
+ ```python
50
+ # 1) Versione fissa di default (1.29.2)
51
+ DiDUPClient("SC12345", "user", "pwd")
52
+
53
+ # 2) Versione fissa esplicita
54
+ DiDUPClient("SC12345", "user", "pwd", version="1.29.2")
55
+
56
+ # 3) Auto-rilevamento dall'App Store al login (sempre aggiornata)
57
+ DiDUPClient("SC12345", "user", "pwd", auto_versione=True)
58
+ ```
59
+
60
+ Puoi anche solo interrogare lo store:
61
+
62
+ ```python
63
+ from didupwrapper import recupera_versione_app
64
+ print(await recupera_versione_app()) # es. "1.29.2"
65
+ ```
66
+
67
+ ## Caratteristiche
68
+
69
+ - Python 3.10+
70
+ - Client **async** (`DiDUPClient`) e **sync** (`DiDUPClientSync`)
71
+ - Modelli **Pydantic v2** con alias camelCase automatici
72
+ - Eccezioni tipizzate: `AuthError`, `RateLimitError`, `NotFoundError`, `DiDUPError`
73
+ - Worker `DashboardPoller` per ricevere notifiche di novità (voti, bacheca, ...)
74
+ - Packaging con `hatchling` + `pyproject.toml`
75
+
76
+ ## Installazione
77
+
78
+ ```bash
79
+ pip install didupwrapper
80
+ ```
81
+
82
+ ## Uso rapido
83
+
84
+ ### Async
85
+
86
+ ```python
87
+ import asyncio
88
+ from didupwrapper import DiDUPClient
89
+
90
+ async def main():
91
+ async with DiDUPClient("SC12345", "mario.rossi", "password") as didup:
92
+ print("Media:", await didup.get_media_generale())
93
+ for voto in await didup.get_voti():
94
+ print(voto.des_materia, voto.cod_codice)
95
+
96
+ asyncio.run(main())
97
+ ```
98
+
99
+ ### Sync
100
+
101
+ ```python
102
+ from didupwrapper import DiDUPClientSync
103
+
104
+ with DiDUPClientSync("SC12345", "mario.rossi", "password") as didup:
105
+ for voto in didup.get_voti():
106
+ print(voto.des_materia, voto.cod_codice)
107
+ ```
108
+
109
+ ## Metodi principali
110
+
111
+ Tutti disponibili sia sul client async (con `await`) che su quello sync:
112
+
113
+ | Metodo | Ritorna |
114
+ |---|---|
115
+ | `get_dashboard()` | `DashboardResponse` (dati aggregati) |
116
+ | `get_voti()` | `list[Voto]` |
117
+ | `get_assenze()` | `list[EventoAppello]` |
118
+ | `get_registro()` | `list[RegistroLezione]` |
119
+ | `get_bacheca()` | `list[ComunicazioneBacheca]` |
120
+ | `get_bacheca_alunno()` | `list[FileBachecaAlunno]` |
121
+ | `get_promemoria()` | `list[Promemoria]` |
122
+ | `get_fuori_classe()` | `list[FuoriClasse]` |
123
+ | `get_note_disciplinari()` | `list[NotaDisciplinare]` |
124
+ | `get_materie()` | `list[Materia]` |
125
+ | `get_docenti()` | `list[Docente]` |
126
+ | `get_periodi()` | `list[Periodo]` |
127
+ | `get_prenotazioni()` | `list[Prenotazione]` |
128
+ | `get_media_generale()` | `float \| None` |
129
+
130
+ ### Endpoint con filtri
131
+
132
+ Il client async espone anche oggetti endpoint con metodi di filtro:
133
+
134
+ ```python
135
+ await didup.voti.per_materia(101)
136
+ await didup.voti.media_per_materia(101)
137
+ await didup.assenze.da_giustificare()
138
+ await didup.bacheca.da_leggere()
139
+ await didup.registro.compiti()
140
+ await didup.fuori_classe.online()
141
+ ```
142
+
143
+ ## Monitoraggio (poller)
144
+
145
+ ```python
146
+ from didupwrapper.workers import DashboardPoller
147
+
148
+ async def on_voti(nuovi):
149
+ for v in nuovi:
150
+ print("Nuovo voto:", v.des_materia, v.cod_codice)
151
+
152
+ poller = DashboardPoller(didup, intervallo=600, on_nuovi_voti=on_voti)
153
+ await poller.avvia() # ferma con poller.ferma()
154
+ ```
155
+
156
+ ## Licenza
157
+
158
+ '''
159
+ MIT License
160
+
161
+ Copyright (c) 2026 Rocciadura
162
+
163
+ Permission is hereby granted, free of charge, to any person obtaining a copy
164
+ of this software and associated documentation files (the "Software"), to deal
165
+ in the Software without restriction, including without limitation the rights
166
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
167
+ copies of the Software, and to permit persons to whom the Software is
168
+ furnished to do so, subject to the following conditions:
169
+
170
+ The above copyright notice and this permission notice shall be included in all
171
+ copies or substantial portions of the Software.
172
+
173
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
174
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
175
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
176
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
177
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
178
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
179
+ SOFTWARE.
180
+ '''
181
+ >>>>>>> 4017c03 (first commit)
@@ -0,0 +1,154 @@
1
+ <<<<<<< HEAD
2
+ # DiDup-API-Wrapper
3
+ Didup API Wrapper | ARGO SOFTWARE
4
+ =======
5
+ # didupwrapper
6
+
7
+ Wrapper Python **open-source** (sync + async) per le API **non documentate** del
8
+ registro elettronico **DiDUP / Argo Famiglia**
9
+
10
+ > Le API non sono pubbliche né documentate da Argo. Questa libreria è basata
11
+ > su reverse-engineering del traffico dell'app. Usala in modo responsabile e
12
+ > solo con le tue credenziali.
13
+ >
14
+ > Il login usa il vero flusso **OAuth2/PKCE** dell'app DidUP Famiglia. L'header
15
+ > `argo-client-version` deve combaciare con l'ultima versione dell'app sugli
16
+ > store (attualmente **1.29.2**): se diventa obsoleto il server risponde `410`.
17
+
18
+ ### Versione client (`argo-client-version`)
19
+
20
+ Tre modi, in ordine di priorità:
21
+
22
+ ```python
23
+ # 1) Versione fissa di default (1.29.2)
24
+ DiDUPClient("SC12345", "user", "pwd")
25
+
26
+ # 2) Versione fissa esplicita
27
+ DiDUPClient("SC12345", "user", "pwd", version="1.29.2")
28
+
29
+ # 3) Auto-rilevamento dall'App Store al login (sempre aggiornata)
30
+ DiDUPClient("SC12345", "user", "pwd", auto_versione=True)
31
+ ```
32
+
33
+ Puoi anche solo interrogare lo store:
34
+
35
+ ```python
36
+ from didupwrapper import recupera_versione_app
37
+ print(await recupera_versione_app()) # es. "1.29.2"
38
+ ```
39
+
40
+ ## Caratteristiche
41
+
42
+ - Python 3.10+
43
+ - Client **async** (`DiDUPClient`) e **sync** (`DiDUPClientSync`)
44
+ - Modelli **Pydantic v2** con alias camelCase automatici
45
+ - Eccezioni tipizzate: `AuthError`, `RateLimitError`, `NotFoundError`, `DiDUPError`
46
+ - Worker `DashboardPoller` per ricevere notifiche di novità (voti, bacheca, ...)
47
+ - Packaging con `hatchling` + `pyproject.toml`
48
+
49
+ ## Installazione
50
+
51
+ ```bash
52
+ pip install didupwrapper
53
+ ```
54
+
55
+ ## Uso rapido
56
+
57
+ ### Async
58
+
59
+ ```python
60
+ import asyncio
61
+ from didupwrapper import DiDUPClient
62
+
63
+ async def main():
64
+ async with DiDUPClient("SC12345", "mario.rossi", "password") as didup:
65
+ print("Media:", await didup.get_media_generale())
66
+ for voto in await didup.get_voti():
67
+ print(voto.des_materia, voto.cod_codice)
68
+
69
+ asyncio.run(main())
70
+ ```
71
+
72
+ ### Sync
73
+
74
+ ```python
75
+ from didupwrapper import DiDUPClientSync
76
+
77
+ with DiDUPClientSync("SC12345", "mario.rossi", "password") as didup:
78
+ for voto in didup.get_voti():
79
+ print(voto.des_materia, voto.cod_codice)
80
+ ```
81
+
82
+ ## Metodi principali
83
+
84
+ Tutti disponibili sia sul client async (con `await`) che su quello sync:
85
+
86
+ | Metodo | Ritorna |
87
+ |---|---|
88
+ | `get_dashboard()` | `DashboardResponse` (dati aggregati) |
89
+ | `get_voti()` | `list[Voto]` |
90
+ | `get_assenze()` | `list[EventoAppello]` |
91
+ | `get_registro()` | `list[RegistroLezione]` |
92
+ | `get_bacheca()` | `list[ComunicazioneBacheca]` |
93
+ | `get_bacheca_alunno()` | `list[FileBachecaAlunno]` |
94
+ | `get_promemoria()` | `list[Promemoria]` |
95
+ | `get_fuori_classe()` | `list[FuoriClasse]` |
96
+ | `get_note_disciplinari()` | `list[NotaDisciplinare]` |
97
+ | `get_materie()` | `list[Materia]` |
98
+ | `get_docenti()` | `list[Docente]` |
99
+ | `get_periodi()` | `list[Periodo]` |
100
+ | `get_prenotazioni()` | `list[Prenotazione]` |
101
+ | `get_media_generale()` | `float \| None` |
102
+
103
+ ### Endpoint con filtri
104
+
105
+ Il client async espone anche oggetti endpoint con metodi di filtro:
106
+
107
+ ```python
108
+ await didup.voti.per_materia(101)
109
+ await didup.voti.media_per_materia(101)
110
+ await didup.assenze.da_giustificare()
111
+ await didup.bacheca.da_leggere()
112
+ await didup.registro.compiti()
113
+ await didup.fuori_classe.online()
114
+ ```
115
+
116
+ ## Monitoraggio (poller)
117
+
118
+ ```python
119
+ from didupwrapper.workers import DashboardPoller
120
+
121
+ async def on_voti(nuovi):
122
+ for v in nuovi:
123
+ print("Nuovo voto:", v.des_materia, v.cod_codice)
124
+
125
+ poller = DashboardPoller(didup, intervallo=600, on_nuovi_voti=on_voti)
126
+ await poller.avvia() # ferma con poller.ferma()
127
+ ```
128
+
129
+ ## Licenza
130
+
131
+ '''
132
+ MIT License
133
+
134
+ Copyright (c) 2026 Rocciadura
135
+
136
+ Permission is hereby granted, free of charge, to any person obtaining a copy
137
+ of this software and associated documentation files (the "Software"), to deal
138
+ in the Software without restriction, including without limitation the rights
139
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
140
+ copies of the Software, and to permit persons to whom the Software is
141
+ furnished to do so, subject to the following conditions:
142
+
143
+ The above copyright notice and this permission notice shall be included in all
144
+ copies or substantial portions of the Software.
145
+
146
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
148
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
149
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
150
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
151
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
152
+ SOFTWARE.
153
+ '''
154
+ >>>>>>> 4017c03 (first commit)
@@ -0,0 +1,100 @@
1
+ """didupwrapper — wrapper Python (sync + async) per le API non documentate
2
+ del registro elettronico DiDUP / Argo Famiglia.
3
+
4
+ Uso rapido (async)::
5
+
6
+ import asyncio
7
+ from didupwrapper import DiDUPClient
8
+
9
+ async def main():
10
+ async with DiDUPClient("SC12345", "mario.rossi", "password") as didup:
11
+ for voto in await didup.get_voti():
12
+ print(voto.des_materia, voto.cod_codice)
13
+
14
+ asyncio.run(main())
15
+
16
+ Uso rapido (sync)::
17
+
18
+ from didupwrapper import DiDUPClientSync
19
+
20
+ with DiDUPClientSync("SC12345", "mario.rossi", "password") as didup:
21
+ print(didup.get_media_generale())
22
+ """
23
+
24
+ from __future__ import annotations
25
+
26
+ from .auth import (
27
+ ArgoConfig,
28
+ Autenticatore,
29
+ Credenziali,
30
+ LoginLink,
31
+ SessioneToken,
32
+ recupera_versione_app,
33
+ )
34
+ from .client import DiDUPClient, DiDUPClientSync
35
+ from .exceptions import (
36
+ AuthError,
37
+ DiDUPError,
38
+ NotFoundError,
39
+ RateLimitError,
40
+ )
41
+ from .models import (
42
+ Allegato,
43
+ ComunicazioneBacheca,
44
+ Compito,
45
+ DashboardResponse,
46
+ DettaglioPrenotazione,
47
+ Docente,
48
+ EventoAppello,
49
+ FileBachecaAlunno,
50
+ FuoriClasse,
51
+ Materia,
52
+ NotaDisciplinare,
53
+ Periodo,
54
+ Prenotazione,
55
+ Promemoria,
56
+ RegistroLezione,
57
+ Voto,
58
+ )
59
+ from .workers import DashboardPoller, EventoPoller
60
+
61
+ __version__ = "0.1.0"
62
+
63
+ __all__ = [
64
+ "__version__",
65
+ # client
66
+ "DiDUPClient",
67
+ "DiDUPClientSync",
68
+ # auth
69
+ "ArgoConfig",
70
+ "Autenticatore",
71
+ "Credenziali",
72
+ "SessioneToken",
73
+ "LoginLink",
74
+ "recupera_versione_app",
75
+ # eccezioni
76
+ "DiDUPError",
77
+ "AuthError",
78
+ "RateLimitError",
79
+ "NotFoundError",
80
+ # modelli
81
+ "DashboardResponse",
82
+ "Voto",
83
+ "EventoAppello",
84
+ "RegistroLezione",
85
+ "Compito",
86
+ "NotaDisciplinare",
87
+ "Promemoria",
88
+ "ComunicazioneBacheca",
89
+ "Allegato",
90
+ "FileBachecaAlunno",
91
+ "FuoriClasse",
92
+ "Materia",
93
+ "Docente",
94
+ "Periodo",
95
+ "Prenotazione",
96
+ "DettaglioPrenotazione",
97
+ # workers
98
+ "DashboardPoller",
99
+ "EventoPoller",
100
+ ]