didupwrapper 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.
|
@@ -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)
|