isoc-ams 0.0.2__py2.py3-none-any.whl → 0.1.1__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.

@@ -0,0 +1,300 @@
1
+ Metadata-Version: 2.4
2
+ Name: isoc-ams
3
+ Version: 0.1.1
4
+ Summary: A Python 3 module to cope with ISOC-AMS.
5
+ Author-email: Klaus Birkenbihl <klaus.birkenbihl@isoc.de>
6
+ Maintainer: Klaus Birkenbihl
7
+ Description-Content-Type: text/markdown
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ License-File: LICENSE
10
+ Requires-Dist: selenium>4
11
+ Project-URL: Home, https://github.com/birkenbihl/isoc-ams
12
+
13
+
14
+ # isoc-ams
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 own Chapter Database with AMS (semi)automatically.
17
+
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
+
20
+ Unfortunately the constraints are severe:
21
+ - access had to be through the web interface since this is the only interface provided. As a consequence it is slow, sometimes unreliable and hard to implement. At least there are working implementations of the "W3C web driver" recommendation. One of them is Selenium used for this project.
22
+ - the existing web interface is far from being stable or guaranteed. So changes to the web interface might spoil the whole project. There is great chance that few weeks from now a new "super duper" AMS will be announced and as always after these announcements things will get worse.
23
+ - tests are close to impossible. There is no such thing as a TEST AMS.
24
+
25
+ Is there a possible good exit? Well, maybe some day soon - in 10 or 20 years if ISOC still exists - there will be an API provided by ISOC that makes this project obsolete. Or at least may be an all-mighty AI will step in. Let's dream on!
26
+
27
+ Status quo: after some experiments with timings isoc-ams seems to run fairly stable for now. The main problem: it takes a lot of time. Not so much an issue if you run it unattended.
28
+
29
+ ## Features
30
+ AMS maintains two main Lists that are relevant for the operation of this interface:
31
+ - a list of ISOC members registered as members of the Chapter
32
+ - a list of ISOC members that applied for a Chapter membership.
33
+
34
+ Consequently isoc-ams provides methods for the following tasks:
35
+ 1. read list of ISOC members registered as Chapter members
36
+ 1. read list of ISOC members that applied for a Chapter membership
37
+ 1. approve ISOC AMS applications
38
+ 1. deny ISOC AMS applications
39
+ 1. delete members from ISOC AMS Chapters Member list
40
+ 1. add members to ISOC AMS Chapters Member list (Chapter admins are not authorized to do this. So the author suggests to write a mail to ams-support.)
41
+
42
+ Don't forget: it takes time and you may see many kinds of errors. Often the cure is "try again later". Any expectation of flawless is not appropriate.
43
+ Anyhow, after running it some time now it seems to work better than expected.
44
+ So here we go:
45
+
46
+ ## Preparing
47
+ ### Prerequisites
48
+ isoc-ams was tested under Linux (Ubuntu 22.04) and Windows 11.
49
+
50
+ Firefox or Chrome Webbrowser with Webdriver (usually included) required.
51
+
52
+ **Known issue: under Windows the Webdriver for Firefox may produce errors esp. when running headless. No problems encountered using the Chrome Webdriver (see below "Choosing a Webdriver). So on Windows - for now - the default Webdriver is Chrome**
53
+
54
+ A full installation of Python 3.9+ is required.
55
+
56
+ ### Installation
57
+ Install (or update) isoc-ams with pip.
58
+
59
+ ```bash
60
+ python -m pip install -U isoc-ams
61
+ ```
62
+
63
+ Recommended to use a virtual environment (venv).
64
+
65
+ ## Running isoc_ams
66
+
67
+ ### Choosing a Webdriver
68
+ You may select a Webdriver of your choice (provided it is one of "firefox" or "chrome") by setting an environment variable ISOC_AMS_WEBDRIVER e.g.:
69
+ ```bash
70
+ ISOC_AMS_WEBDRIVER=firefox
71
+ ```
72
+ Recommended (and default) is "firefox". Because of Windows problems default on Windows for now is chrome.
73
+ ### Start execution of the module
74
+ So this happens if we call the module with:
75
+ ```bash
76
+ python -m isoc_ams
77
+ ```
78
+ Output:
79
+ ```
80
+ Username:xyz
81
+ Password:
82
+
83
+ *************************************
84
+ 2025-07-13 19:25:54 - INFO - START
85
+ *************************************
86
+
87
+ 2025-07-13 19:25:54 - INFO - logging in
88
+
89
+ *************************************************************
90
+ 2025-07-13 19:25:59 - ERROR - Invalid username or password.
91
+ *************************************************************
92
+ ```
93
+ OK, probably your fault. After fixing:
94
+ ```
95
+ Username: xxx
96
+ Password:
97
+
98
+ *************************************
99
+ 2025-07-13 19:26:27 - INFO - START
100
+ *************************************
101
+
102
+ 2025-07-13 19:26:27 - INFO - logging in
103
+ 2025-07-13 19:26:45 - INFO - Now on Chapter Leader portal
104
+
105
+
106
+ 2025-07-13 19:26:45 - INFO - start build members list
107
+ 2025-07-13 19:27:36 - INFO - members list finished / 59 collected
108
+
109
+
110
+ 2025-07-13 19:27:36 - INFO - start build pending applications
111
+ 2025-07-13 19:27:50 - INFO - Pending applications list finished / 8 collected
112
+
113
+
114
+ ***************************************
115
+ 2025-07-13 19:27:50 - INFO - MEMBERS
116
+ ***************************************
117
+ 1 22158 ...
118
+ 2 ...
119
+ ...
120
+
121
+ ****************************************************
122
+ 2025-07-13 19:27:50 - INFO - PENDING APPLICATIONS
123
+ ****************************************************
124
+ 1 2323 ...
125
+ 2 ...
126
+ ...
127
+ ```
128
+ As you can see from the time stamps: building the lists is rather tedious. And finding all required info is a bit tricky sometimes.
129
+
130
+ ### Logging
131
+ Since crazy things may happen it is important to keep track of what is going on. So ISOC_AMS lets you know what it is doing
132
+ by providing a logfile. With the option --debug you will get a more detailed log. Logs usually go to stdout.
133
+
134
+
135
+ ### Running with head
136
+ Normally isoc_ams won't show any browser output - running headless. To do debugging it might useful to follow the activities in the browser. If you call isoc_ams with a -h option like
137
+ ```bash
138
+ python -m isoc_ams -h
139
+ ```
140
+ the browser will open and you can follow all activities real time.
141
+
142
+ ### User input and Dryrun
143
+ An argument -i tells the module that there will be (or is) input available with actions to execute.
144
+ An argument -d tells isoc_ams to make a dry run. Actions will be computed but not executed.
145
+
146
+ Again an example:
147
+ ```bash
148
+ python -m isoc_ams -i -d
149
+ ```
150
+ Output:
151
+ ```
152
+ Username: xxx
153
+ Password:
154
+
155
+ ********************************************
156
+ 2025-07-15 10:35:57 - INFO - START DRYRUN
157
+ ********************************************
158
+
159
+ 2025-07-15 10:35:57 - INFO - logging in
160
+ 2025-07-15 10:36:12 - INFO - Now on Chapter Leader portal
161
+
162
+
163
+ 2025-07-15 10:36:12 - INFO - start build members list
164
+ 2025-07-15 10:37:03 - INFO - members list finished / 59 collected
165
+
166
+
167
+ 2025-07-15 10:37:03 - INFO - start build pending applications
168
+ 2025-07-15 10:37:17 - INFO - Pending applications list finished / 9 collected
169
+
170
+
171
+ ***************************************
172
+ 2025-07-15 10:37:17 - INFO - MEMBERS
173
+ ***************************************
174
+ 1 2217734 Johannes Piesepampel self@piesepampel.com
175
+ ...
176
+
177
+ ****************************************************
178
+ 2025-07-15 10:37:17 - INFO - PENDING APPLICATIONS
179
+ ****************************************************
180
+ 1 23232 Franz Piesepampel franz@piesepampel.com 2025-01-22
181
+ 2 22556 Abdul Piesepampel abdul@piesepampel.com 2025-03-21
182
+ ...
183
+ READING COMMANDS:
184
+ ```
185
+ *` deny 23232 22556 123`*
186
+ ```
187
+ 2025-07-15 10:38:17 Denied 23232 Franz Piesepampel
188
+ 2025-07-15 10:38:17 Denied 22556 Abdul Piesepampel
189
+ *******************************************************************************
190
+ 2025-07-15 10:38:17 ISOC-ID 123 is not in pending applications list
191
+ *******************************************************************************
192
+ ```
193
+ *` delete 2217734`*
194
+ ```
195
+ 2025-07-15 10:38:59 Deleted 2217734 Johannes Piesepampel
196
+ 2025-07-15 10:37:17
197
+ ```
198
+
199
+ The following commands are available:
200
+ * deny (followed by a comma or space separated list of ISOC-IDs):
201
+ deny Chapter membership for these applicants
202
+ * approve (followed by a comma or space separated list of ISOC-IDs):
203
+ approve Chapter membership for these applicants
204
+ * delete (followed by a comma or space separated list of ISOC-IDs):
205
+ delete these members from the Capter members list
206
+
207
+ ## Using the API
208
+
209
+ isoc_ams unleashes its full power when used as API to make things happen without human intervention. Check the file "[isoc_de_ams_main.py](https://github.com/birkenbihl/isoc-ams/blob/main/isoc_de_ams_main.py)" as an example for fully automatic synchronizing of local membership administration with AMS.
210
+
211
+ Here the output:
212
+ ```
213
+
214
+ *************************************
215
+ 2025-07-15 14:13:36 - INFO - START
216
+ *************************************
217
+
218
+ 2025-07-15 14:13:36 - INFO - logging in
219
+ 2025-07-15 14:13:53 - INFO - Now on Chapter Leader portal
220
+
221
+
222
+ 2025-07-15 14:13:53 - INFO - start build members list
223
+ 2025-07-15 14:14:44 - INFO - members list finished / 59 collected
224
+
225
+
226
+ 2025-07-15 14:14:44 - INFO - start build pending applications
227
+ 2025-07-15 14:14:57 - INFO - Pending applications list finished / 8 collected
228
+
229
+ 2025-07-15 14:14:57 - INFO - Pending Applications:
230
+
231
+ the following pending applications will be approved:
232
+ ...
233
+
234
+ the following pending applications will be denied:
235
+ ...
236
+
237
+ the following pending applications will be invited:
238
+ ...
239
+
240
+ the following pending applications will be waiting:
241
+ ...
242
+
243
+ 2025-07-15 14:14:57 - INFO - Members:
244
+
245
+ the following members will be deleted from AMS:
246
+ ...
247
+
248
+ for the following members a nagging mail will be sent to AMS-support (we are not authorized to fix it!):
249
+ ...
250
+
251
+ the following locally registered members are in sync with AMS:
252
+ ...
253
+
254
+ 2025-07-15 14:14:57 - INFO - start delete ...
255
+ 2025-07-15 14:15:10 - INFO - done
256
+ 2025-07-15 14:15:10 - INFO - Deleted 233658 ...
257
+
258
+
259
+ *************************************************************************
260
+ 2025-07-15 14:15:10 - INFO - Check if actions ended up in AMS database
261
+ *************************************************************************
262
+ 2025-07-15 14:15:10 - INFO - we have to read the AMS Database tables again to find deviations from expected result after actions :(
263
+
264
+
265
+ 2025-07-15 14:15:10 - INFO - start build members list
266
+ 2025-07-15 14:15:56 - INFO - members list finished / 59 collected
267
+
268
+
269
+ 2025-07-15 14:15:56 - INFO - start build pending applications
270
+ 2025-07-15 14:16:06 - INFO - Pending applications list finished / 8 collected
271
+
272
+ 2025-07-15 14:16:06 - INFO - everything OK
273
+ ```
274
+
275
+ The mail to be send to AMS-support team might look like this:
276
+
277
+ Dear AMS-support team,
278
+
279
+ this is an automatic, complimentary Message from the ISOC German Chapter
280
+ Members Administration System (ISOC.DE MAS).
281
+
282
+ Assuming you are interested in making ISOC AMS consistent, the purpose
283
+ of this message is to help you with valid, up-to-date data.
284
+
285
+ The following individuals are legally registered paying members
286
+ of ISOC.DE - many of them for more than 25 years. They all are
287
+ also registered as ISOC (global) members. Unfortunately they are
288
+ not registered with AMS as members of ISOC.DE. Even more we are
289
+ not authorized to fix this. So we forward this data to your attention:
290
+
291
+ Uwe Mayer, xxx@yyy.com (ISOC-ID=1234567)
292
+ ...
293
+
294
+ Thank you,
295
+
296
+ Your ISOC.DE MAS support team
297
+
298
+ 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.
299
+
300
+
@@ -0,0 +1,5 @@
1
+ isoc_ams.py,sha256=yCn-97ofCPsX7Ceh3I_eK9nVXNI96Tcvpb6YNPpHLQU,37412
2
+ isoc_ams-0.1.1.dist-info/licenses/LICENSE,sha256=BJcMew_kvBWHjs-_Hd_OMHnxOLmeczeT88V4gFCT21U,1067
3
+ isoc_ams-0.1.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
4
+ isoc_ams-0.1.1.dist-info/METADATA,sha256=yRQKS5IHCMJRVG_n0LSRcRKoFq4yx2n51aQRuYpdb9Y,11501
5
+ isoc_ams-0.1.1.dist-info/RECORD,,