isoc-ams 0.0.2__py2.py3-none-any.whl → 0.1.0__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/METADATA +291 -0
- isoc_ams-0.1.0.dist-info/RECORD +5 -0
- isoc_ams.py +372 -261
- isoc_ams-0.0.2.dist-info/METADATA +0 -261
- isoc_ams-0.0.2.dist-info/RECORD +0 -5
- {isoc_ams-0.0.2.dist-info → isoc_ams-0.1.0.dist-info}/WHEEL +0 -0
- {isoc_ams-0.0.2.dist-info → isoc_ams-0.1.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: isoc-ams
|
|
3
|
+
Version: 0.1.0
|
|
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 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
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
Install (or update) isoc-ams with pip.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python -m pip install -U isoc-ams
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Recommended to use a virtual environment (venv).
|
|
55
|
+
|
|
56
|
+
## Running isoc_ams
|
|
57
|
+
|
|
58
|
+
### Choosing a Webdriver
|
|
59
|
+
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.:
|
|
60
|
+
```bash
|
|
61
|
+
ISOC_AMS_WEBDRIVER=firefox
|
|
62
|
+
```
|
|
63
|
+
Recommended (and default) is "firefox".
|
|
64
|
+
### Start execution of the module
|
|
65
|
+
So this happens if we call the module with:
|
|
66
|
+
```bash
|
|
67
|
+
python -m isoc_ams
|
|
68
|
+
```
|
|
69
|
+
Output:
|
|
70
|
+
```
|
|
71
|
+
Username:xyz
|
|
72
|
+
Password:
|
|
73
|
+
|
|
74
|
+
*************************************
|
|
75
|
+
2025-07-13 19:25:54 - INFO - START
|
|
76
|
+
*************************************
|
|
77
|
+
|
|
78
|
+
2025-07-13 19:25:54 - INFO - logging in
|
|
79
|
+
|
|
80
|
+
*************************************************************
|
|
81
|
+
2025-07-13 19:25:59 - ERROR - Invalid username or password.
|
|
82
|
+
*************************************************************
|
|
83
|
+
```
|
|
84
|
+
OK, probably your fault. After fixing:
|
|
85
|
+
```
|
|
86
|
+
Username: xxx
|
|
87
|
+
Password:
|
|
88
|
+
|
|
89
|
+
*************************************
|
|
90
|
+
2025-07-13 19:26:27 - INFO - START
|
|
91
|
+
*************************************
|
|
92
|
+
|
|
93
|
+
2025-07-13 19:26:27 - INFO - logging in
|
|
94
|
+
2025-07-13 19:26:45 - INFO - Now on Chapter Leader portal
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
2025-07-13 19:26:45 - INFO - start build members list
|
|
98
|
+
2025-07-13 19:27:36 - INFO - members list finished / 59 collected
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
2025-07-13 19:27:36 - INFO - start build pending applications
|
|
102
|
+
2025-07-13 19:27:50 - INFO - Pending applications list finished / 8 collected
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
***************************************
|
|
106
|
+
2025-07-13 19:27:50 - INFO - MEMBERS
|
|
107
|
+
***************************************
|
|
108
|
+
1 22158 ...
|
|
109
|
+
2 ...
|
|
110
|
+
...
|
|
111
|
+
|
|
112
|
+
****************************************************
|
|
113
|
+
2025-07-13 19:27:50 - INFO - PENDING APPLICATIONS
|
|
114
|
+
****************************************************
|
|
115
|
+
1 2323 ...
|
|
116
|
+
2 ...
|
|
117
|
+
...
|
|
118
|
+
```
|
|
119
|
+
As you can see from the time stamps: building the lists is rather tedious. And finding all required info is a bit tricky sometimes.
|
|
120
|
+
|
|
121
|
+
### Logging
|
|
122
|
+
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
|
|
123
|
+
by providing a logfile. With the option --debug you will get a more detailed log. Logs usually go to stdout.
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Running with head
|
|
127
|
+
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
|
|
128
|
+
```bash
|
|
129
|
+
python -m isoc_ams -h
|
|
130
|
+
```
|
|
131
|
+
the browser will open and you can follow all activities real time.
|
|
132
|
+
|
|
133
|
+
### User input and Dryrun
|
|
134
|
+
An argument -i tells the module that there will be (or is) input available with actions to execute.
|
|
135
|
+
An argument -d tells isoc_ams to make a dry run. Actions will be computed but not executed.
|
|
136
|
+
|
|
137
|
+
Again an example:
|
|
138
|
+
```bash
|
|
139
|
+
python -m isoc_ams -i -d
|
|
140
|
+
```
|
|
141
|
+
Output:
|
|
142
|
+
```
|
|
143
|
+
Username: xxx
|
|
144
|
+
Password:
|
|
145
|
+
|
|
146
|
+
********************************************
|
|
147
|
+
2025-07-15 10:35:57 - INFO - START DRYRUN
|
|
148
|
+
********************************************
|
|
149
|
+
|
|
150
|
+
2025-07-15 10:35:57 - INFO - logging in
|
|
151
|
+
2025-07-15 10:36:12 - INFO - Now on Chapter Leader portal
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
2025-07-15 10:36:12 - INFO - start build members list
|
|
155
|
+
2025-07-15 10:37:03 - INFO - members list finished / 59 collected
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
2025-07-15 10:37:03 - INFO - start build pending applications
|
|
159
|
+
2025-07-15 10:37:17 - INFO - Pending applications list finished / 9 collected
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
***************************************
|
|
163
|
+
2025-07-15 10:37:17 - INFO - MEMBERS
|
|
164
|
+
***************************************
|
|
165
|
+
1 2217734 Johannes Piesepampel self@piesepampel.com
|
|
166
|
+
...
|
|
167
|
+
|
|
168
|
+
****************************************************
|
|
169
|
+
2025-07-15 10:37:17 - INFO - PENDING APPLICATIONS
|
|
170
|
+
****************************************************
|
|
171
|
+
1 23232 Franz Piesepampel franz@piesepampel.com 2025-01-22
|
|
172
|
+
2 22556 Abdul Piesepampel abdul@piesepampel.com 2025-03-21
|
|
173
|
+
...
|
|
174
|
+
READING COMMANDS:
|
|
175
|
+
```
|
|
176
|
+
*` deny 23232 22556 123`*
|
|
177
|
+
```
|
|
178
|
+
2025-07-15 10:38:17 Denied 23232 Franz Piesepampel
|
|
179
|
+
2025-07-15 10:38:17 Denied 22556 Abdul Piesepampel
|
|
180
|
+
*******************************************************************************
|
|
181
|
+
2025-07-15 10:38:17 ISOC-ID 123 is not in pending applications list
|
|
182
|
+
*******************************************************************************
|
|
183
|
+
```
|
|
184
|
+
*` delete 2217734`*
|
|
185
|
+
```
|
|
186
|
+
2025-07-15 10:38:59 Deleted 2217734 Johannes Piesepampel
|
|
187
|
+
2025-07-15 10:37:17
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The following commands are available:
|
|
191
|
+
* deny (followed by a comma or space separated list of ISOC-IDs):
|
|
192
|
+
deny Chapter membership for these applicants
|
|
193
|
+
* approve (followed by a comma or space separated list of ISOC-IDs):
|
|
194
|
+
approve Chapter membership for these applicants
|
|
195
|
+
* delete (followed by a comma or space separated list of ISOC-IDs):
|
|
196
|
+
delete these members from the Capter members list
|
|
197
|
+
|
|
198
|
+
## Using the API
|
|
199
|
+
|
|
200
|
+
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.
|
|
201
|
+
|
|
202
|
+
Here the output:
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
*************************************
|
|
206
|
+
2025-07-15 14:13:36 - INFO - START
|
|
207
|
+
*************************************
|
|
208
|
+
|
|
209
|
+
2025-07-15 14:13:36 - INFO - logging in
|
|
210
|
+
2025-07-15 14:13:53 - INFO - Now on Chapter Leader portal
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
2025-07-15 14:13:53 - INFO - start build members list
|
|
214
|
+
2025-07-15 14:14:44 - INFO - members list finished / 59 collected
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
2025-07-15 14:14:44 - INFO - start build pending applications
|
|
218
|
+
2025-07-15 14:14:57 - INFO - Pending applications list finished / 8 collected
|
|
219
|
+
|
|
220
|
+
2025-07-15 14:14:57 - INFO - Pending Applications:
|
|
221
|
+
|
|
222
|
+
the following pending applications will be approved:
|
|
223
|
+
...
|
|
224
|
+
|
|
225
|
+
the following pending applications will be denied:
|
|
226
|
+
...
|
|
227
|
+
|
|
228
|
+
the following pending applications will be invited:
|
|
229
|
+
...
|
|
230
|
+
|
|
231
|
+
the following pending applications will be waiting:
|
|
232
|
+
...
|
|
233
|
+
|
|
234
|
+
2025-07-15 14:14:57 - INFO - Members:
|
|
235
|
+
|
|
236
|
+
the following members will be deleted from AMS:
|
|
237
|
+
...
|
|
238
|
+
|
|
239
|
+
for the following members a nagging mail will be sent to AMS-support (we are not authorized to fix it!):
|
|
240
|
+
...
|
|
241
|
+
|
|
242
|
+
the following locally registered members are in sync with AMS:
|
|
243
|
+
...
|
|
244
|
+
|
|
245
|
+
2025-07-15 14:14:57 - INFO - start delete ...
|
|
246
|
+
2025-07-15 14:15:10 - INFO - done
|
|
247
|
+
2025-07-15 14:15:10 - INFO - Deleted 233658 ...
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
*************************************************************************
|
|
251
|
+
2025-07-15 14:15:10 - INFO - Check if actions ended up in AMS database
|
|
252
|
+
*************************************************************************
|
|
253
|
+
2025-07-15 14:15:10 - INFO - we have to read the AMS Database tables again to find deviations from expected result after actions :(
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
2025-07-15 14:15:10 - INFO - start build members list
|
|
257
|
+
2025-07-15 14:15:56 - INFO - members list finished / 59 collected
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
2025-07-15 14:15:56 - INFO - start build pending applications
|
|
261
|
+
2025-07-15 14:16:06 - INFO - Pending applications list finished / 8 collected
|
|
262
|
+
|
|
263
|
+
2025-07-15 14:16:06 - INFO - everything OK
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
The mail to be send to AMS-support team might look like this:
|
|
267
|
+
|
|
268
|
+
Dear AMS-support team,
|
|
269
|
+
|
|
270
|
+
this is an automatic, complimentary Message from the ISOC German Chapter
|
|
271
|
+
Members Administration System (ISOC.DE MAS).
|
|
272
|
+
|
|
273
|
+
Assuming you are interested in making ISOC AMS consistent, the purpose
|
|
274
|
+
of this message is to help you with valid, up-to-date data.
|
|
275
|
+
|
|
276
|
+
The following individuals are legally registered paying members
|
|
277
|
+
of ISOC.DE - many of them for more than 25 years. They all are
|
|
278
|
+
also registered as ISOC (global) members. Unfortunately they are
|
|
279
|
+
not registered with AMS as members of ISOC.DE. Even more we are
|
|
280
|
+
not authorized to fix this. So we forward this data to your attention:
|
|
281
|
+
|
|
282
|
+
Uwe Mayer, xxx@yyy.com (ISOC-ID=1234567)
|
|
283
|
+
...
|
|
284
|
+
|
|
285
|
+
Thank you,
|
|
286
|
+
|
|
287
|
+
Your ISOC.DE MAS support team
|
|
288
|
+
|
|
289
|
+
See file [isoc_ams.html](https://github.com/birkenbihl/isoc-ams/blob/main/isoc_ams.html) for doc on the API interface.
|
|
290
|
+
|
|
291
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
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,,
|