isoc-ams 0.1.0__py2.py3-none-any.whl → 0.1.2__py2.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.
Potentially problematic release.
This version of isoc-ams might be problematic. Click here for more details.
- {isoc_ams-0.1.0.dist-info → isoc_ams-0.1.2.dist-info}/METADATA +28 -16
- isoc_ams-0.1.2.dist-info/RECORD +5 -0
- isoc_ams.py +42 -28
- isoc_ams-0.1.0.dist-info/RECORD +0 -5
- {isoc_ams-0.1.0.dist-info → isoc_ams-0.1.2.dist-info}/WHEEL +0 -0
- {isoc_ams-0.1.0.dist-info → isoc_ams-0.1.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: isoc-ams
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: A Python 3 module to cope with ISOC-AMS.
|
|
5
5
|
Author-email: Klaus Birkenbihl <klaus.birkenbihl@isoc.de>
|
|
6
6
|
Maintainer: Klaus Birkenbihl
|
|
@@ -13,7 +13,7 @@ Project-URL: Home, https://github.com/birkenbihl/isoc-ams
|
|
|
13
13
|
|
|
14
14
|
# isoc-ams
|
|
15
15
|
|
|
16
|
-
A Python Interface to access the 'Advanced Members Administration System' (AMS) of the 'Internet Society' (ISOC). This is especially useful for ISOC Chapter Admins who want to synchronize their Chapter Database with AMS (semi)automatically.
|
|
16
|
+
A Python Interface to access the 'Advanced Members Administration System' (AMS) of the 'Internet Society' (ISOC). This is especially useful for ISOC Chapter Admins who want to synchronize their own Chapter Database with AMS (semi)automatically.
|
|
17
17
|
|
|
18
18
|
After 10 years+ of sorrow, millions minutes of waiting for answers from the AMS web interface, tons of useless clicks, many (in fact) rejected requests to provide an API access: the author decided to build an API himself. Even if it might not be more than a demonstrator for the functionality needed. Anyhow (see below): for now it is running on a weekly basis doing a great job in avoiding manual work.
|
|
19
19
|
|
|
@@ -43,8 +43,20 @@ Don't forget: it takes time and you may see many kinds of errors. Often the cure
|
|
|
43
43
|
Anyhow, after running it some time now it seems to work better than expected.
|
|
44
44
|
So here we go:
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Preparing
|
|
47
|
+
### Prerequisites
|
|
48
|
+
isoc-ams was tested under Linux (Ubuntu 22.04) and Windows 11.
|
|
47
49
|
|
|
50
|
+
**While rather stable under Linux, Windows 11 produced mixed results. Under powershell you may need to set the ExecutionPolicy**
|
|
51
|
+
```
|
|
52
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Firefox or Chrome Webbrowser with Webdriver (usually included) is required.
|
|
56
|
+
|
|
57
|
+
A full installation of Python 3.9+ is required.
|
|
58
|
+
|
|
59
|
+
### Installation
|
|
48
60
|
Install (or update) isoc-ams with pip.
|
|
49
61
|
|
|
50
62
|
```bash
|
|
@@ -71,9 +83,9 @@ Output:
|
|
|
71
83
|
Username:xyz
|
|
72
84
|
Password:
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
2025-07-13 19:25:54 - INFO - START
|
|
76
|
-
|
|
86
|
+
***********************************************************
|
|
87
|
+
2025-07-13 19:25:54 - INFO - START: Webdriver is firefox
|
|
88
|
+
***********************************************************
|
|
77
89
|
|
|
78
90
|
2025-07-13 19:25:54 - INFO - logging in
|
|
79
91
|
|
|
@@ -86,9 +98,9 @@ OK, probably your fault. After fixing:
|
|
|
86
98
|
Username: xxx
|
|
87
99
|
Password:
|
|
88
100
|
|
|
89
|
-
|
|
90
|
-
2025-07-13 19:26:27 - INFO - START
|
|
91
|
-
|
|
101
|
+
***********************************************************
|
|
102
|
+
2025-07-13 19:26:27 - INFO - START: Webdriver is firefox
|
|
103
|
+
***********************************************************
|
|
92
104
|
|
|
93
105
|
2025-07-13 19:26:27 - INFO - logging in
|
|
94
106
|
2025-07-13 19:26:45 - INFO - Now on Chapter Leader portal
|
|
@@ -143,9 +155,9 @@ Output:
|
|
|
143
155
|
Username: xxx
|
|
144
156
|
Password:
|
|
145
157
|
|
|
146
|
-
|
|
147
|
-
2025-07-15 10:35:57 - INFO - START DRYRUN
|
|
148
|
-
|
|
158
|
+
******************************************************************
|
|
159
|
+
2025-07-15 10:35:57 - INFO - START DRYRUN: Webdriver is firefox
|
|
160
|
+
*****************************************************************
|
|
149
161
|
|
|
150
162
|
2025-07-15 10:35:57 - INFO - logging in
|
|
151
163
|
2025-07-15 10:36:12 - INFO - Now on Chapter Leader portal
|
|
@@ -202,9 +214,9 @@ isoc_ams unleashes its full power when used as API to make things happen without
|
|
|
202
214
|
Here the output:
|
|
203
215
|
```
|
|
204
216
|
|
|
205
|
-
|
|
206
|
-
2025-07-15 14:13:
|
|
207
|
-
|
|
217
|
+
***********************************************************
|
|
218
|
+
2025-07-15 14:13:30 - INFO - START: Webdriver is firefox
|
|
219
|
+
***********************************************************
|
|
208
220
|
|
|
209
221
|
2025-07-15 14:13:36 - INFO - logging in
|
|
210
222
|
2025-07-15 14:13:53 - INFO - Now on Chapter Leader portal
|
|
@@ -286,6 +298,6 @@ Thank you,
|
|
|
286
298
|
|
|
287
299
|
Your ISOC.DE MAS support team
|
|
288
300
|
|
|
289
|
-
See file [isoc_ams.html](https://github.com/birkenbihl/isoc-ams/blob/main/isoc_ams.html) for doc on the API interface.
|
|
301
|
+
See file [isoc_ams.html](https://html-preview.github.io/?url=https://github.com/birkenbihl/isoc-ams/blob/main/isoc_ams.html) for doc on the API interface.
|
|
290
302
|
|
|
291
303
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
isoc_ams.py,sha256=jrlY2qFp4adJRc7JDv2QlyQE4SXb70WEm-WSkE6lXVI,38023
|
|
2
|
+
isoc_ams-0.1.2.dist-info/licenses/LICENSE,sha256=BJcMew_kvBWHjs-_Hd_OMHnxOLmeczeT88V4gFCT21U,1067
|
|
3
|
+
isoc_ams-0.1.2.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
4
|
+
isoc_ams-0.1.2.dist-info/METADATA,sha256=VOOwPNqW_i7782x0gRCuZ5xxXjs7lkZ1b-IYl6YODNQ,11658
|
|
5
|
+
isoc_ams-0.1.2.dist-info/RECORD,,
|
isoc_ams.py
CHANGED
|
@@ -85,8 +85,12 @@ CHANGELOG
|
|
|
85
85
|
Version 0.1.0
|
|
86
86
|
Improved logging
|
|
87
87
|
minor bug fixes
|
|
88
|
+
Version 0.1.1
|
|
89
|
+
minor bug fixes
|
|
90
|
+
Version 0.1.2
|
|
91
|
+
eliminate not required checks in difference_from_expected()
|
|
88
92
|
"""
|
|
89
|
-
__version__ = "0.1.
|
|
93
|
+
__version__ = "0.1.2"
|
|
90
94
|
|
|
91
95
|
from selenium import webdriver
|
|
92
96
|
from selenium.webdriver.common.by import By
|
|
@@ -232,13 +236,13 @@ ARGUMENTS
|
|
|
232
236
|
_init_logging(logfile, debuglog)
|
|
233
237
|
self._ams = _ISOC_AMS()
|
|
234
238
|
if self._dryrun:
|
|
235
|
-
strong_msg("START DRYRUN")
|
|
239
|
+
strong_msg("START DRYRUN:", "Version:", __version__, "Webdriver is", _dr)
|
|
236
240
|
else:
|
|
237
|
-
strong_msg("START")
|
|
241
|
+
strong_msg("START:", "Version:", __version__, "Webdriver is", _dr)
|
|
238
242
|
self._ams.login((user, password))
|
|
239
243
|
self._members_list = self._ams.build_members_list()
|
|
240
244
|
self._pending_applications_list = self._ams.build_pending_applicants_list()
|
|
241
|
-
|
|
245
|
+
self.approve_list = self.delete_list = self.deny_list = None
|
|
242
246
|
|
|
243
247
|
@property
|
|
244
248
|
def members_list(self) -> dict:
|
|
@@ -298,6 +302,7 @@ ARGUMENTS
|
|
|
298
302
|
"""
|
|
299
303
|
if type(delete_list) in (str, int):
|
|
300
304
|
delete_list = [delete_list]
|
|
305
|
+
self.delete_list = delete_list
|
|
301
306
|
for deletee in map(str, delete_list):
|
|
302
307
|
if deletee in self._members_list:
|
|
303
308
|
deletee = str(deletee)
|
|
@@ -325,6 +330,7 @@ ARGUMENTS
|
|
|
325
330
|
"""
|
|
326
331
|
if type(approve_list) in (int, str):
|
|
327
332
|
approve_list = [approve_list]
|
|
333
|
+
self.approve_list = approve_list
|
|
328
334
|
for approvee in map(str, approve_list):
|
|
329
335
|
if approvee in self._pending_applications_list:
|
|
330
336
|
if approvee not in self._members_list:
|
|
@@ -358,6 +364,7 @@ ARGUMENTS
|
|
|
358
364
|
"""
|
|
359
365
|
if type(deny_list) in (str, int):
|
|
360
366
|
deny_list = [deny_list],
|
|
367
|
+
self.deny_list = deny_list
|
|
361
368
|
for denyee in map(str, deny_list):
|
|
362
369
|
if denyee in self._pending_applications_list:
|
|
363
370
|
if not self._dryrun:
|
|
@@ -404,29 +411,36 @@ RETURNS
|
|
|
404
411
|
not_deleted = {}
|
|
405
412
|
not_approved = {}
|
|
406
413
|
not_removed_from_pending = {}
|
|
407
|
-
|
|
414
|
+
|
|
415
|
+
if self.approve_list or self.delete_list:
|
|
416
|
+
new_members_list = self._ams.build_members_list()
|
|
417
|
+
if self.deny_list or self.approve_list:
|
|
418
|
+
new_pending_applications_list = self._ams.build_pending_applicants_list()
|
|
419
|
+
|
|
408
420
|
dlog("Check members list")
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
421
|
+
if self.delete_list:
|
|
422
|
+
for nm in new_members_list:
|
|
423
|
+
if nm not in self._members_list:
|
|
424
|
+
dlog(new_members_list[nm]["first name"],
|
|
425
|
+
new_members_list[nm]["last name"],
|
|
426
|
+
"("+nm+")",
|
|
427
|
+
"was not deleted")
|
|
428
|
+
not_deleted[nm] = new_members_list[nm]
|
|
429
|
+
if self.approve_list:
|
|
430
|
+
for nm in self._members_list:
|
|
431
|
+
if nm not in new_members_list:
|
|
432
|
+
dlog(self._members_list[nm]["first name"],
|
|
433
|
+
self._members_list[nm]["last name"],
|
|
434
|
+
"("+nm+")",
|
|
435
|
+
"was not approved")
|
|
436
|
+
not_approved[nm] = self._members_list[nm]
|
|
437
|
+
if self.deny_list:
|
|
438
|
+
for np in new_pending_applications_list:
|
|
439
|
+
if np not in self._pending_applications_list:
|
|
440
|
+
dlog(self._members_list[nm]["name"],
|
|
441
|
+
"("+nm+")",
|
|
442
|
+
"was not removed from pending aoolications")
|
|
443
|
+
not_removed_from_pending[np] = new_pending_applications_list[np]
|
|
430
444
|
|
|
431
445
|
result = {}
|
|
432
446
|
if not_deleted:
|
|
@@ -943,8 +957,8 @@ if __name__ == "__main__":
|
|
|
943
957
|
password,
|
|
944
958
|
headless=headless,
|
|
945
959
|
dryrun=dryrun,
|
|
946
|
-
logfile=
|
|
947
|
-
debuglog=
|
|
960
|
+
logfile=sys.stdout,
|
|
961
|
+
debuglog=None,
|
|
948
962
|
)
|
|
949
963
|
else:
|
|
950
964
|
ams = ISOC_AMS(
|
isoc_ams-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
isoc_ams.py,sha256=sTYYGMvGKhQjR8SIMer8Op4yewKKwjVCFpNAh6wrBG4,37324
|
|
2
|
-
isoc_ams-0.1.0.dist-info/licenses/LICENSE,sha256=BJcMew_kvBWHjs-_Hd_OMHnxOLmeczeT88V4gFCT21U,1067
|
|
3
|
-
isoc_ams-0.1.0.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
4
|
-
isoc_ams-0.1.0.dist-info/METADATA,sha256=J72vjyyTc8yXEx54vXaW3xaQBVEBUcHblO3RFMRuMfE,10928
|
|
5
|
-
isoc_ams-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|